|
Hello,
I am writing an application that communicates with an external device using a USB port. I have the USB driver for the device, but I want to automate the installation of the driver inside the application so the user does not have to install the driver manually. I have embedded the INF and SYS files in the application, so that when the application starts, these files are written to the hard drive. Once the files are on the hard drive, I want the app call whatever windows functions there are to install the driver.
The easy method would be to copy the driver to the system32 directory and let the wizard install it when the device plugs in, but I hate wizards and don't want the user bothered by it.
I have not yet been able to get the driver installation to work. I have tried doing a ShellExecute of RunDll32.exe with the command line info pointing to the INF file, but I never see the driver get installed into the system32 directory. When I plug the device into the PC, Windows does not recognize it.
Any ideas? Is there another way of doing this besides Shelling RunDll32.exe?
|
|
|
|
|
The Setup functions are used to install stuff. Going this route is a bit complicated, though, since the documentation on SetupXxx is not the best. It would be much easier just to let the install hardware wizard do its thing, but if you insist, research the Setup functions.
Judy
|
|
|
|
|
Hi all,
I am sorry but its really urgent and I hope u will help me.
I use SendInput API function to emulate keystrokes like this:
void CKeyboardInput::KeyDown(WORD wVK)<br />
{<br />
INPUT inKB;<br />
<br />
::ZeroMemory(&inKB,sizeof(INPUT));<br />
<br />
inKB.type=INPUT_KEYBOARD;<br />
inKB.ki.wVk=wVK;<br />
<br />
SendInput(1,&inKB,sizeof(INPUT));<br />
<br />
}
The code runs perfectly with all normal windows applications, however, this code doesnt work for some types of programs like Games, for example I want to send a key to move a car in Need for Speed II or in Driver but I failed to get it to work.
Anybody can point out any useful comments? why dont these apps respond to SendInput calls? and is there any workaround?
Waiting for good news
Thanks
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Games probably use DirectInput hence SendKeys cannot work.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks for ur reply,
But is there any solution for this? how can I send keystrokes to a game?
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
I think there is no solution. But I'm not an expert about.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi,
I have about 3 Megs of data coming in at intervals of about 100 times a second. I am trying to write this into the harddrive so that I can do some post processing after all the data is written to a file. I am finding that the hard drive cant keep up and it actually causes data to be dropped. So what I did was implemented a queue where I can put into memory and then I wrote another thread to copy off the data to the harddrive but that is still not doing the trick. The memory writes are way too quick and my circular queue gets full before the hardrive writes are done, so then the thread needs to wait.
I need to be able to record this data for a large amount of time, say about 1 to 2 hours without losing any data. I get loss of data within 10 seconds. I am going crazy here, if there is another approach to doing this I am all ears, even if it calls for a full overhaul of my application, or if there is something else I am doing wrong.
All the code is written in C++.
Thanks in advance
|
|
|
|
|
Two questions:
1) Where is your data coming from?
2) Is your hard drive physically capable of that data rate?
|
|
|
|
|
1.) the data is coming from a DAQ Board
2.) I dont know the datarate of the hard drive.
Is there a way to do this without using the harddrive?
Thanks
|
|
|
|
|
godspeed123 wrote: Is there a way to do this without using the harddrive?
Not and keep your "I am trying to write this into the harddrive so that I can do some post processing after all the data is written to a file." requirement.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for the response.
So that means I am screwed, lol. Is there any other approach that I can use to get around this, even if it means rewriting all the code.
|
|
|
|
|
Hello,
Are you saying 3MB x 100 times/second = 300MegaByte/sec? If this is the case, you need some special hard drives, i.e. SAS or SCSI 15K rpm, in RAID 0 with 4 or 6 such drives. Then it may be possible to capture data without lose.
Conventional single 7.2K rpm desktop drives only can maintain ~50MegaByte/sec and you need to pay attention on that.
Hope it helps.
|
|
|
|
|
We too ran into a similar problem. We are streaming video over USB 2.0 from a cell phone to a PC as the device plays a video or pans with camera. We ran into a problem where the system could not keep up. So we tried using a memory mapped file instead of using the old standard CreateFile() and WriteFile(). That did speed things up to where we could capture data at 40 frames a second but we still have an issue at 80 fps.
|
|
|
|
|
Hmmm my stuff is coming in at about 100 times a second, I will give it a shot, but as you guys did I'm sure I will hit the same pitfalls. Is there anything else you tried that worked?
Thanks again.
|
|
|
|
|
No. That's the best solution we found for speed.
|
|
|
|
|
godspeed123 wrote: I have about 3 Megs of data coming in at intervals of about 100 times a second.
You are receiving 300MB of data every second? I'm not sure of any HD that can write that fast.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think by 3 Megs, he means 3 MB.
Shog on learning VB6: Ah, that would have been VB6. Kicked my ass anyway. So easy to learn, just like falling down a flight of stairs...
|
|
|
|
|
brahmma wrote: I think by 3 Megs, he means 3 MB.
No kidding. I've never known "megs" to mean anything other than MB.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: You are receiving 300MB of data every second? I'm not sure of any HD that can write that fast.
The above quote is from your previous post. I did not reply to tell megs is MB, but I said the OP meant 3MB and not 300 MB.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
brahmma wrote: ...the OP meant 3MB and not 300 MB.
Last time I checked, 3MB 100 times per second was equal to 300MB per second.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
What I understood from the original post was, the total amount of data received is 3MB every second, and is not received at a shot, but is received in 100 intervals.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
A standard hard drive maximum write speed is theoretically 12.5 MBs per second (Megabytes, not Megabits) if I remember correctly.
Even if you had a 15,000 RPM SATA, SAS, or SCSI you probably won't see over 20-30 MB/s.
You will need to have a RAID 5 or better of at least 10 high-performance drives to handle all this data, but even that would probably barely do it.
The other option is to install GBs upon GBs of RAM and just Queue it all up like you've been doing. You're not going to get 1-2 hours of data, though, at all on your current setup. You'll have to read for 5 minutes, wait until the Queue is empty, and then collect more data.
That's the only solution I can think of, and it's merely a money issue. Fast storage is expensive.
|
|
|
|
|
I cannot understand what the problem is with this code and why I get this error:
error C2621: union 'EntryInfoUnion' : member 'strInfoStruct' has copy constructor
struct floatInfoStruct
{
float min;
float max;
float* result;
float test;
};
struct intInfoStruct
{
int min;
int max;
int* result;
int test;
};
struct timeInfoStruct
{
SECONDS min;
SECONDS max;
SECONDS *result;
TimeFormats Format;
SECONDS test;
};
struct angleInfoStruct
{
DEGREES *result;
DEGREES test;
};
struct latlonInfoStruct
{
LAT_DEGREES *lat_result;
LON_DEGREES *lon_result;
LAT_DEGREES lat_test;
LON_DEGREES lon_test;
};
struct baroInfoStruct
{
float min;
float max;
float *result;
float test;
};
struct strInfoStruct
{
CString min;
CString max;
CString *result;
CString test;
};
union EntryInfoUnion
{
floatInfoStruct floatInfo;
intInfoStruct intInfo;
timeInfoStruct timeInfo;
angleInfoStruct angleInfo;
latlonInfoStruct latlonInfo;
baroInfoStruct baroInfo;
strInfoStruct strInfo;
};
What does the error message (union 'EntryInfoUnion' : member 'strInfoStruct' has copy constructor) trying to tell me.
I just don't see the problem with the code snippet.
Thanks.
John P.
|
|
|
|
|
jparken wrote: union EntryInfoUnion
{
...
strInfoStruct strInfo;
};
Union members are not allowed to have (copy) constructors.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
David, maybe I can't see the forest for the trees. What is the difference between, say, "floatInfoStruct floatInfo;", and "strInfoStruct strInfo;" being part of the union and causing the 'copy constructor' error?
Can you explain this in more detail, please?
Thank you.
John P.
|
|
|
|