It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have searched StackOverlow and googled myself silly, but can't find a solution to this problem.
What I wish to do is be able to preview the contents of a file. I can do this at present for a BMP, JPEG etc. but I'd like to be able to do it for any file that has a default program association. The most likely example is a PDF file, but any file is theoretically possible in this application.
What I had in mind was to:-
Open the file (with ShellExecuteEx?)
Wait for the open to complete
Copy the contents of the first window displayed by the opening program
Save the window to a TBitMap
Close the file/program/window
Display the captured BMP in a TImage as my preview.
I reckon that I can do steps 1 and 6, but the bits in the middle have me beaten :-(
I'm working with Delphi-7
Cheers
Jeff
You can try the Windows Preview Handlers, you can Host a existing Preview Handler in your app and also create your own.
Check these resources.
Hosting Preview Handlers
Hosting Preview Handlers in Windows Applications
Creating Preview Handlers with Delphi
Is there a Preview Handler VCL for Windows 7?
Windows 7 Previews – the Delphi Way
delphi-preview-handler (Delphi Open Source Project)
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
The VCL does not natively allow forms other than the MainForm to host MDI child forms. This is a hard-coded limitation on Borland's part, not a limitation in Microsoft's MDI architecture. Microsoft allows multiple windows in an application to host MDI children. There is no concept of MainForms in the Win32 API.
I have tried converting the below embarcadro c++ example to embarcadro delphi without success.
I keep encountering the error "no mdi forms are currently active" when creating the mdi child forms.
This c++ sample demonstrates how to allow a non-MDI project to host multiple MDI parent forms, none of which are the VCL's MainForm.
Download with Information (Account required to download)
http://cc.embarcadero.com/item/23574
Direct Download (No account required to download)
http://www.delphibasics.info/MultipleMDIParentFormsInASingleApplication.zip
I would be grateful if someone would convert this sample from embarcadro c++ language to embarcadro delphi language. Thank you.
Quality Central #12006 Hosting MDI child forms in non-MainForm forms has detailed steps in its workaround description for how to add support for that. It does involve patching the VCL sources though, and was posted against Delphi 2005, so some of the steps may have changed. It's also been closed as Won't Do, so if you pursue that approach you'll have to maintain it yourself long-term.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have file.c file that I want to add to my ios app. I renamed it to file.m, rename the main() to main2() and included it in my project in xCode. It compiles fine but how do I run main2()?
Could someone please explain this in detail? Thanks.
More likely than not, the main of the original C program is going to try and set up a processing loop or otherwise wait for some kind of input and then try to process it.
You aren't going to be able to simply embed one entire program in another and expect it to work unmodified. You'll need to understand how the second program works and then integrate that functionality into the first. Without seeing the implementation of your second main, it is impossible to say more.
You have to call main2() somewhere in your main source file. main() is the entry point for C programs, so if you rename main() to something else, you will have to call it manually.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a requirement where, I need to give the user only one editable java class where he can make changes in the program such as changing username, changing phone number. The moment he saves the data, the built program should be able to reproduce the changes.
I am doing this project for BlackBerry.
I want to know, is there any way in which I can link a class with external project? I am developing the project using Eclipse. I don't know how the user will make changes and save. I know it's a little weird but generally speaking, I want to link two different applications using some middle interface. Any help is greatly appreciated
I believe this is a simple case of "You think you know what you want but you really don't" :)
Please explain what it is you want to achieve between your two apps and how they interact and we will provide you with a much better solution than asking a user to modify java files.
UPDATE AFTER OP COMMENT :
You need to look at XML or JSON. These are ways to format data so that it is easy to write/produce/transfert/parse.
Parsing XML on Blackberry
Parse XML file on BlackBerry
When you build a java project you get a jar file. If you include that jar file into the classpath, all of its contents will be available to your code (with necessary import statements).
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have been researching this problem for a while now and I just can't seem to get it right. I have a C++ version of the software I would like to make in delphi, but I can't get it to work in delphi. I need some sort of tutorial or guide that can show me how to connect to, read and write data to a HID USB device.
See Jan Axelson's USB page for examples. He has written a book also. USB Complete.
See also Robert Marquardt's HID controller suite for Delphi.
If you are using Delphi 2009 or newer, follow the link given in the answer on SO question :using-hidcontroller-on-delphi-2010
You can use QueryDosDevice to obtain the full device name. List all entries before you plug-in the device, and after, and see which new entry appears in the list. (I've found that most HID devices apear twice in the list, haven't found why yet). The code will contain "USB" "VID" "PID" and a GUID.
You can use this code with CreateFile if you prefix it with ´\\?\´ and use this Handle as a Serial Port (I personally prefer using THandleStream). The code could look like this:
var
h:THandle;
begin
h:=CreateFile(
PChar('\\?\'+MyPortName),
GENERIC_WRITE or GENERIC_READ,FILE_SHARE_WRITE or FILE_SHARE_READ,
nil,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
if h=INVALID_HANDLE_VALUE then RaiseLastOSError;
MyPort:=THandleStream.Create(h);
SetCommTimeouts(h,MyFCommTimeouts);
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Sometimes i upload files to a website like attachments ..
The websites doesn't tell me where was the file uploaded
but it says yes it was uploaded
as im the uploader, is it possible to track the file location ?
whats the path of it in the website ?
Take stack overflow for example. If you upload an image as part of a question or answer, then the image is displayed on the screen when viewing the relevant item. If its being displayed in your browser, you can always find the URL by using your favorite web development toolkit.
So if you can access the resource in the browser, you have a url.
That doesn't necessarily translate into the exact location on the site's server, however. There is no way to know for sure where it is kept.
And if you upload something and it is never displayed back to you, there is no way to know.
Whether or not you have the right to know is a different matter entirely. It probably depends on the site's EULA. But as an opinion, noone forces you to upload anything. If you choose to do so, I think you give up the right to know where they put your contribution.