|
Cedric Moonen wrote: Whith what are you trying to communicate ?
My colleague told me to make a utility which can write some data into his micro-controller via USB this morning.
Maxwell Chen
|
|
|
|
|
Well, he then need to supply you with the appropriate USB driver. And with some documentation about this driver. In general, you open the driver using CreateFile and then you can use the standard ReadFile and WriteFile functions. But, you can also exchange some specific commands with the driver using DeviceIOControl (in which case, the code you pass to your driver is very specific).
|
|
|
|
|
Thank you very much!
Maxwell Chen
|
|
|
|
|
hi,
I have a multithreaded program.
In one thread, I have a very important section. I want to put all other thread to sleep when this thread comes to this section. Is there anyway to do this?
The data in this section is accessed from many many places so it's almost impossible to use CCriticalSection to lock it.
thanks for any help.
|
|
|
|
|
You'd be much better off putting in the effort to hide this data behind some interface with locking built in than try to put all the other threads to sleep.
Im sure you can find api's to enumerate the threads in your program and pause each of them but I think that would be very dangerous
|
|
|
|
|
GameProfessor wrote: hi,
I have a multithreaded program.
In one thread, I have a very important section. I want to put all other thread to sleep when this thread comes to this section. Is there anyway to do this?
The data in this section is accessed from many many places so it's almost impossible to use CCriticalSection to lock it.
This is a bad design and is asking for trouble. My advice would be "don't go there". Apart from the pitfalls[^] of putting threads to "sleep", how can you be sure one of the threads hasn't been interrupted in the middle of an update operation to the shared data and left it in an invalid state?
Steve
|
|
|
|
|
thanks, although your comment make me creepy :
I think I'll try Josh Gray's advice: trying to build a interface to lock my section. It could be difficult but it seems worthy to try.
|
|
|
|
|
How do i use the push button function to activate the LEDs connected through the parallel port?
i got a source code that uses check boxes to toggle the LEDs but instead of having current flow through the whole time when the check boxes are clicked, i decided to use the push button as it allows the current to flow through whenever it is pressed.
is it easier to control the LEDs using the keyboard arrows? if so how? are there any examples of source codes?
|
|
|
|
|
I think you have to implement a customize button to get that effect, because you need an action when the button is just pressed and stop that action when it is released.
You can use keydown message for handling the keyboard.
- NS -
|
|
|
|
|
I have some simple questions , thank you very much...
1. How can i get Owner and Group SIDs and matched username and groupnames for a file/folder using windows registry ?
2. How can i get SACL and DACL of a file/folder using windows registry ?
|
|
|
|
|
Akin Ocal wrote: 1. How can i get Owner and Group SIDs and matched username and groupnames for a file/folder using windows registry ?
2. How can i get SACL and DACL of a file/folder using windows registry ?
Both of these can be acheived with API's rather than looking at the registry directly. Search MSDN to find the required API functions
|
|
|
|
|
|
I have some simple questions , thank you very much...
1. How can i get Owner and Group SIDs and matched username and groupnames of a file/folder ?
2. How can i get DACL and SACL of a file/folder ? Are they human-readable , if not how can they be parsed into a human-readable form ?
3. How can i get number of data streams and read data streams ( without changing access-time) of a file/folder ?
|
|
|
|
|
I have set the cursor property of my Windows Form to "No". When I move between records the cursor switches to the arrow.
If I click anywhere on the form, outside of a field, the cursor changes to the desired "No" cursor.
What I am asking help with is the line of code that will simulate the user clicking the mouse?
Thanking you in advance for your help and time.
|
|
|
|
|
You can use the SendMessage for sending the mouse messages WM_LBUTTONDOWN and WM_LBUTTONUP
- NS -
|
|
|
|
|
I tried the following without success.
SendMessage(WM_LBUTTONDOWN, 0, 0);
and received the following error messages
Form1.h(590): error C2065: 'WM_LBUTTONDOWN' : undeclared identifier
Form1.h(590): error C3861: 'SendMessage': identifier not found, even with argument-dependent lookup
Could you be more specific what I need to do?
Thanking you in advance for your help and time.
|
|
|
|
|
Whats your application type?
|
|
|
|
|
I'm using Visual Studio .NET 2003 Professional (C++). I've created a Windows Form.net that has fields and buttons on the form. I've created a data file and as records are read the TextBoxes on the form are populated. The cursor property of the Form is set to the "No" cursor. Before I open the data file the cursor displays as No everywhere on the form exept over the Open button where I have it display as the hand cursor. Whenever I move to another record the cursor changes to the arrow/default? cursor again. However if I click anywhere on any "empty" area of the form the cursor changes to No which is how I want it to be displayed unless the user clicks the Edit button.
The help or line of code I am looking for is one that simulates the user clicking somewhere on the form to change the cursor to display the No symbol.
I would insert that code after the record is read to change the cursor to No.
Thanking you in advance for your help and time.
|
|
|
|
|
I asked for application type because I wanted why you got this error but anyway see
See Mouse Input
[^] is helpfuls for you
|
|
|
|
|
Thanks for the suggestion of Mouse Input.
I incluced "windows.h" and I tried the following line of code without success.
MOUSEINPUT(0, 0, 0, MOUSEEVENTF_LEFTDOWN, 0, 0);
I find it difficult understanding Microsoft's documentation as I am a newbie.
Could you please help me out?
Thanking you in advance for your help and time.
|
|
|
|
|
|
Another way to do this is by using the mouse_event() API call. This is more useful if you want to synthesise some more complex mouse movements, and it takes these as parameters. Take a look at the documentation on MSDN for more.
MSDN also states that for Windows NT/2000/XP/Vista, mouse_event() has been superseded by SendInput() instead. Have a look at the MSDN documentation for this also.
Hope this helps!
--PerspX
|
|
|
|
|
Hello,
I was running just fine until I put on a support pack today. I don't know whether this error is related, since I am having the issue on two different computers.
When I attempt to compile a VC++ .exe, I am now getting this error:
general error c101008a: Failed to save the updated manifest to the file ".\release with tnc\xsupptray.exe.embed.manifest"
Anybody ever seen this error? Any idea what might be causing it?
BRC
Brc
|
|
|
|
|
Nothing like answering my own question.
I did a Clean on the projects in question, and the problem went away.
Just in case someone ever sees this. Now you know what to do.
BRC
|
|
|
|
|