|
I am going to develop a automatic windows service which continuously moniters for devices connected to USB .. and i need to get type of device connected to usb port(ex:keyboard or mem stick etc...). What are the functions in windows API to do above things?
Thanks in advance..
|
|
|
|
|
Have you looked at HKLM\SYSTEM\CurrentControlSet\Enum\USB and HKLM\SYSTEM\CurrentControlSet\Enum\USBSTOR keys? The LocationInformation value is indicative of what the device is.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Take a look at the SetupDiEnumDeviceInterfaces() function
#include <devguid.h>
InterfaceClassGuid = GUID_DEVCLASS_USB
Mark
|
|
|
|
|
Is this[^] helpful for you
|
|
|
|
|
Hi ,
I have created edit boxes using the following
vector<cricheditctrl*>RichEditBox;
CRichEditCtrl *r1 = new CRichEditCtrl;
r1->Create(WS_CHILD|WS_VISIBLE|ES_AUTOVSCROLL,
CRect(x1,y1,x2,y2), p, 1);
r1->SetEventMask(ENM_CHANGE | ENM_SELCHANGE );
RichEditBox.push_back(r1);
With the above code I get empty CRichEditboxes on the current window.Now I want to navigate through these boxes with Up Down arrow keys.
What should I do ?
Please help
Prithaa
|
|
|
|
|
what's a vectorRichEditBox ?
|
|
|
|
|
I think he forgot to check ignore the html tags option.
He should be having vector<CRichEditCtrl*> RichEditBox
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
vector<CRichEditCtrl *>RichEditBox;
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
normally I would only use the TAB ( and the tab order ) to navigate a series of controls like that.
BUT
you could override the ON_CHAR ( ? ) and handle the down and up key to call either NextDlgCtrl PrevDlgCtrl .
You will need to set the ordering manually, which I'm not certain on how to do it.
|
|
|
|
|
Hi,
in my vc++ application i need to import a dll. I did by the statement
#import"test.dll"
but it is giving compilation error as
fatal error C1083: Cannot open type library file: 'test.dll': No
such file or directory
Cany any one help me how to resolve this issue
Thanks
bollapalli
|
|
|
|
|
use function LoadLibrary( LPCTSTR filename ) in the 'filename' give the relative path of the dll with ref to ur current exe...
|
|
|
|
|
Thanks for the timely help!!!
bollapalli
|
|
|
|
|
As far as I know, you cannot use import to load a dll. You need to link to the lib file that is supplied with your dll and include the header files which are also supplide with it in your project. Then of course the dll needs to be disctributed with your application.
|
|
|
|
|
Thanks for the timely help for you too!!!
bollapalli
|
|
|
|
|
Cedric Moonen wrote: As far as I know, you cannot use import to load a dll.
Actually you can. The OP's problem is simply that the DLL could not be found by the preprocessor.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Actually you can.
It's the first time I heard that. How does it work then ? How can you call functions from your dll afterwards ?
|
|
|
|
|
Cedric Moonen wrote: How can you call functions from your dll afterwards ?
In the same way you would any other type library.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
So, basically it is the same as implicit linking, except you don't need the lib file anymore ? Am I right ?
Never heard about such a thing...
|
|
|
|
|
See if this helps clear the fog.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Ok, I got it. But still, for regular dll's, this won't work. So, his post was not totally clear about it, he just said that he wanted to load a dll (for me, that means a regular dll).
|
|
|
|
|
I think the point here is that #import is used to pull in TLBs, so just as you can import a TLB file directly, you can use it on a DLL that has an embedded TLB in it...?
Just a thought...
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hey,
how can I cut needless decimal digits from a calculation result
e.g. calculation with pow(10.0,-1.0)
10^-1 = 0.100000000001 but I need to have 0.1
|
|
|
|
|
You can't. This is due to the precision of the floating point representation. But why do you want to do such a thing ? I think the error due to precision is very neglectable here.
|
|
|
|
|
You mean for display, or internally ? ((int)(x*10))/10.0 would give you one decimal place. Not sure if there's a more built in way to do it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|