|
Not very sure if this is the right discussion branch for this, but could not find anything else more matching.
Q:
I use DeviceIOControl to pass data to driver from a VC++ application. Everything works fine. Th eisuue is, if the usb device is hanging, not replying, my PC hangs. I need some timeout in deviceiocontrol, not sure of how to do that.
To make it more clear, pc sends data, if device does not repond till some time, it should return with fail code..
please help
-KK
- KK
|
|
|
|
|
You could start a separate thread, which calls DeviceIOControl and signals when the DeviceIOControl has returned.
In the main thread (or in another thread), wait for the signal from the DeviceIOControl-thread.
If the signal from the DeviceIOControl-thread doesn't happen in a given time frame, consider it to be a timeout and handle it in the main thread.
|
|
|
|
|
Did you open the USB device with the FILE_FLAG_OVERLAPPED flag?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
NO. I pass a NULL for overlapped. Is there a way to make a timeout using overlapped and not using additional threads?
- KK
|
|
|
|
|
I want to create a list control with tree control properties like bitmap buttons for each item, dark lines with parent child hierarchy.
The cursor should be full row select, ie., should cover both the ends of the list control.
This list control should be supported with an external scroll bar.
Kindly help me if any program is available for the above function in either Win32 / MFC based Visual C++ application
|
|
|
|
|
There are alot of article at codeprojects regarding listbox and list control.
Check Combo Box[^] Section at codeproject
SaRath.
"Don't Do Different things... Do Things Differently..."
|
|
|
|
|
Hi All,
What is the difference between .h and .hpp files ???
Thanks in Advance.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
hpp files
A header file written in the C++ programming language. It should be in simple ASCII and (depending upon how portably it was written) should be usable on any machine with a C++ compiler. Typically it would be used in conjunction with a C file. Note that the h extension is also sometimes used for C++ header files.
h
A header file written in either the C, C++, Objective-C, Objective-C++, or Inform programming language. It should be in simple ASCII and (depending upon how portably it was written) should be usable on any machine with a C (or C++, ObjC, or ObjC++ as appropriate) compiler. Typically it would be used in conjunction with a c or C file.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks buddy
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
_AnShUmAn_ wrote: Typically it would be used in conjunction with a C file.
HPP files are typically used with CPP files.
_AnShUmAn_ wrote: Typically it would be used in conjunction with a c or C file.
Huh? What is the difference between a c file and a C file?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
NiceNaidu wrote: What is the difference between .h and .hpp files ???
None really. It is just a matter of style. They both can contain the same code.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I made a program with VC++/MFC. The program is for communication with a opc-server (PLS) an is running all the time.
Now I found out in the taskmanager, that the number of page errors is very high. I know, that the page errors are not a really error. This are only the memory-pages which are saved in the virtuell RAM and not in the RAM.
But writting the memory-pages to the virtuell RAM needs much mor time as handling with the RAM.
So how can I find out which part of my program causes the page errors. How can I prevent the page-errors?
-- modified at 2:37 Wednesday 7th June, 2006
|
|
|
|
|
I am using Sleep(n) in my application which is giving me a lot of inaccuracy..almost 50millisec..My Threads call Sleep and so the synchronisation is lost...
this is causing many of my actions to go out of turn and calculations are getting too inaccurate...could anyone please give easy code to replace the Sleep and add it to my code...
Thanks in advance
Shreyas Ganesh
-- modified at 2:30 Wednesday 7th June, 2006
|
|
|
|
|
Which accuracy do you need to have ? If you look for an accuracy under 15 msec (approximately), then you can forget about it. Windows is not a real-time operating system and thus, you cannot have precision under 10 or 15 msec (depends of which version of windows you are using). If you don't need a so much precision but still want to have something better than Sleep, you can have a look at GetTickCount[^]. You'll be able to do something with it.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Shreyas Ganesh wrote: My Threads call Sleep and so the synchronisation is lost...
Use Synchronisation techniques instead of Sleep..
several synchronisation techniques are available here
CriticalSecction,
mutex,
semaphors, etc.
Use appropriate for efficiency and performance.
Knock out 't' from can't,
You can if you think you can
![Cool | :cool:](https://www.codeproject.com/script/Forums/Images/smiley_cool.gif)
|
|
|
|
|
Hi to all,
I need a sample code or information regarding the following....(in win32)
create a dialog,place own window on it...
Thanking you
Manjunath S
|
|
|
|
|
|
Hi,
can we create a dialog and create a child window of our own class on that dialog (win32 applcation).
Manjunath S
|
|
|
|
|
|
best example create one projectWin32(Win32Project) with VS
whitesky
|
|
|
|
|
i face a problem
problem is that then i make dialog box in mfc and make its class and also make a menu then i add this menu to the the dailog box . menu contain two commands one for addition and one for updation.
i make second dialog box in mfc then i add some edit controls on it and make a class of this dailog box.
so when i click on addtion command on menu in first dialog box it display second dialog box
and when i click on updation command in menu then it will again display second dialog box but now i want that some edit controls are disabled that is they can not take value
how can i do this
plz help me whoever know this
thanks
ya u give solution but that is not solve my problem
i want to disable it from menu which is on first dailog box and i want to disable edit control on second dailog box so enablewindow demand of object and i declare object of that edit in second dialog box and in first it will not take that one
hi
-- modified at 2:28 Wednesday 7th June, 2006
|
|
|
|
|
for disable and enable controls use EnableWindow
whitesky
|
|
|
|
|
yar it will not so easy as i want to do it from menu to other dialog box
hi
|
|
|
|
|
so you need to Here[^]
whitesky
|
|
|
|
|
We have already provided a solution for your problem. What problem are you still facing
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|