|
Can someone give an example on where to use CMultilocks? A snippet. What does it do actually?
To use a CMultiLock object, first create an array of the synchronization objects that you wish to wait on. Next, call the CMultiLock object's constructor inside a member function in the controlled resource's class. Then call the Lock member function to determine if a resource is available (signaled). If one is, continue with the remainder of the member function. If no resource is available, either wait for a specified amount of time for a resource to be released, or return failure. After use of a resource is complete, either call the Unlock function if the CMultiLock object is to be used again, or allow the CMultiLock object to be destroyed.
A snippet please.
|
|
|
|
|
Are you looking for something like this,
CSyncObject* pSyncObjArray[2];
pSyncObjArray[0] = &mutex1;
pSyncObjArray[1] = &mutex1;
CMultiLock multi(pSyncObjArray, 2);
multi.Lock(INFINITE, TRUE, 0);
multi.Unlock();
|
|
|
|
|
Yes. Thanks Prasan som . Why finding a code for CMultilock is so difficult? even google didn't return proper examples Btw, did you vote me down?? after answering me? or why did I got voted down by someone?
286? WOWW!
|
|
|
|
|
_8086 wrote: Thanks Prasan som .
Welcome !
_8086 wrote: Why finding a code for CMultilock is so difficult? even google didn't return proper examples
Actually, it depends on how frequently its needed, I thing its rarely needed.
_8086 wrote: Btw, did you vote me down??
No, its not me. But, really strange question.
_8086 wrote: or why did I got voted down by someone?
There is no answer to this question.
|
|
|
|
|
hi,
a little question:
If i use the Dialog Ressource Editor, the size of the Dialog, displayed in the bottom-right corner says me for example 500x375 pixel. Calculating the size with another programm, the size is greater than 500x375 pixels.
At the execution of the application, i get also another value (via getWindowRect) for the width&height
Why does it display a different size ?
Thanks
|
|
|
|
|
The numbers you see in resource editors are using dilaog unit(DLU) .
One horizontal dilaog unit is 1/4 th of average of dialog box font width and one vertical dialog unit is 1/8 th of average of dialog box font height.
|
|
|
|
|
oha
What is it good for?
Thx prasad_som
|
|
|
|
|
baerten wrote: What is it good for?
Its by standard for MS.
baerten wrote: Thx prasad_som
Its my pleasure to help you.
|
|
|
|
|
baerten wrote: What is it good for?
It's a device-independent unit of measurement, whereas pixel is not.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
mmh, okay ...
Also thanks to you
|
|
|
|
|
baerten wrote: Also thanks to you
"Rate this message" option is there for a reason.
|
|
|
|
|
ok, i gave you the full-power
What are the ratings good for?
|
|
|
|
|
Its just as cortesy shown, and it will increase credentials of volunteers , who help others. In your case, atleast , you turn back to say thanks. Which does not happen many times.
|
|
|
|
|
Oki doki
Yes, it's important to thanks the person who helps, but sometimes i also forgot it.
The user is so happy that the problem is solved and he can continue his work
The CodeProject-User helps me a lot, that's great, because without all these help i had
already lost my job
|
|
|
|
|
Hi all,
Is there anyone who has worked with SAP(Systems Applications and Products in Data Processing) RFC and VC++ before.
Many thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Hi,
I have an GUI based windows application which has text box, edit box fields whose values gets updated from time to time.
I Need to get the field values of this GUI application using another application and store them in a file on a periodic basis.
BTW,I don't have the source code of the GUI application.
Can it be done using windows messaging or suggest me a way how to go about doing this..
Thanks,
|
|
|
|
|
TssPrasad wrote: Can it be done using windows messaging or suggest me a way how to go about doing this..
use FindWindow to Find the Window Handle of the Text Box and using WM_GETTEXT method retrieve the length... Before sending the WM_GETTEXT, send WM_GETTEXTLENGTH to retrieve the length of the Text
|
|
|
|
|
Thanks alok for the idea..
>>The FindWindow function retrieves a handle to the top-level window whose >>class name and window name match the specified strings
what can i do to know the class name & window name...
>>WM_GETTEXT message to copy the text that corresponds to a window into a buffer provided by the caller.
if a window has many text edit box, will it copy all the text corresponding to the windows fields??
can you please clarify.
|
|
|
|
|
TssPrasad wrote: what can i do to know the class name & window name...
Window Name is name of the application Window.. from there you have to Enumerate the Child Window using FindWindowEx function (sorry my mistake here). i believe your seond problem solved using Handle return by FindWindowEx!
|
|
|
|
|
TssPrasad wrote: what can i do to know the class name & window name...
Use Spy++.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am handling NM_DBLCLK message for a CListCtrl in my application. In that function I need to know the point where the double click is made. How can i know that?
|
|
|
|
|
Aryan S wrote: I am handling NM_DBLCLK message for a CListCtrl in my application. In that function I need to know the point where the double click is made. How can i know that?
GetCursorPos and ScreenToClient
|
|
|
|
|
NM_DBLCLK sents this information in NMITEMACTIVATE parameter.
|
|
|
|
|
Hi all.
I have data in my ODBC, and I need to see it in my window like grid.
|
|
|
|
|
You can use ADO in combination with datagrid control.
Refer this[^] article by
Rashid Thadha.
|
|
|
|