How can i communicate with an HID USB device in delphi [closed] - delphi

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);

Related

Capture the screen shot of another application's screen Delphi [closed]

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)

I want to learn driver developement so how to start in this? [closed]

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 want to learn device driver development so how to start ? Any media for beginner or something ?
The canonical reference is Linux Device Drivers 3rd Edition - although it's a few years old now, it's close enough to current kernels.
Quite a lot of stuff is not covered in here - particularly anything that's device or bus specific, or the way the kernel has been developing to support ARM SoC devices over the last few years.
I would suggest to go start learing Linux device driver under PC environment so as you can co-relate most of things you are familier with ,One approach is to go get linux source code and try to understand how kernel is being called and how single user space process is initiated from kernel space .You can also follow this below given page would be helpful for you.
http://en.wikiversity.org/wiki/Reading_the_Linux_Kernel_Sources

Replace crHourGlass with the new Windows 7 "snake eating its tail" cursor [closed]

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.
My Delphi XE2 apps look a bit dated these days because they use:
Screen.Cursor := crHourglass;
Is there a way to change the cursor to the the more modern looking rotating "snake eating its tail" icon that Windows uses?
Other than this Am I restricted to the cursor numbers defined in Controls.pas under Delphi 7? I haven't been able to find anything on SO or Google that addresses this.
Snake eating its tail cursor preview:
Different Windows schemes have different cursors. If you are using one of the Aero schemes then you will see the cursors to which you refer. If you are using, for example, Windows Classic, then you will see the older XP style cursors.
Screen.Cursor := crHourglass;
is all you need to do to show the currently active scheme's busy cursor.
Basically the crHourGlass is a 'wrapper' to the 'busy' Windows cursor.
You may change it 'manually' in your system 'Mouse' control panel :configure your 'Pointer' settings from the model you want.

Converting an app to a Binary [closed]

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 been given a project and asked to convert it to binary so my boss can submit it to the App Store. I am using xcode 4.3.1; how can I do this?
Sorry: I don't have any code (I don't think this can be done through code) or any thing that i have done to demonstrate.
If you've already been testing on an iOS device, then you already have a binary. It's what gets downloaded to the device to run your app.
What you might actually need to do is to learn how to archive, codesign, and submit the app.
For that, nothing beats reading Apple's documentation. All of it. Not some short hint or a paragraph or two. Lots can go wrong if you don't read it all.
Open Xcode. Click Help. Type "Distributing Applications" in the search.
The developer website also has mountains of information on how to do this.

Seeking book about Indy using Delphi [closed]

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 already asked a few beginner questions, found some demos, altered them and realize that I might have a lot more questions ...
Should I use Indy 10 or 9 with Delphi 7?
What if my server wants to broadcast something to all the clients?
too many more to list, and I'd rather educate myself, if I can, than continually ask for help
Does anyone know of a book which covers Indy programming in Delphi (preferably D7) ?
Googling for "indy book delphi" returns "Indy in Depth" http://www.atozed.com/indy/book/index.nl.aspx as the first result. The page mentions it hasn't been updated recently, but as you are using Delphi 7 it will probably still be pertinent to you.
Im currently using 9 with Delphi 7. No issue for me so far - mainly work with UDP/TCP servers/clients.
Indy 10 AFAIK has architectually changed under the hood, so definately pick one and stick with it. I have looked into upgrading but it seems it will require a code change for me, but i would normally advise to choose the latest version, since you will have better support.
Check the Indy homepage for more info (note i think its a bit outdated):
http://www.indyproject.org/download/Files/Indy10.html
Here is also an article about the fundamental differences between the two:
http://conferences.embarcadero.com/article/32160

Resources