|
In this case, I use PostThreadMessage, then how to use wParam and lParam?
Extreme programming. Do the No.1
|
|
|
|
|
MSDN:
You can use the PostThreadMessage function to post a message to a specific thread message queue. PostThreadMessage is similar to PostMessage, except the first parameter is a thread identifier rather than a window handle. You can retrieve the thread identifier by calling theGetCurrentThreadId function.
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
After I use wParam & lParam in PostThreadMessage, then I use GetMessage() to accept them, then where can I get the wParam & lParam sent from PostThreadMessage. Appreciation.
Extreme programming. Do the No.1
|
|
|
|
|
BOOL GetMessage(
LPMSG lpMsg,
HWND hWnd,
UINT wMsgFilterMin,
UINT wMsgFilterMax
);
Pass a pointer to a MSG variable to GetMessage()
The MSG Struct has LPARAM and WPARAM members.
Signature space for rent. Apply by email to....
|
|
|
|
|
Still can't work, because of datatype casting.
suppose, I want to send two parameters, one is BYTE* m_pByte, the other, int m_nLen. Then, I use PostThreadMessage Like this,
::PostThreadMessage(m_threadID,WM_DATA_ARRIVAL,(WPARAM)m_pByte,(LPARAM)m_nLen);
Now I use GetMessage() to get the message (here is WM_DATA_ARRIVAL) as well as m_pByte and m_nLen,
<br />
...<br />
MSG msg;<br />
while(::GetMessage(&msg, NULL, 0,0))<br />
{<br />
switch(msg.message)<br />
{<br />
case WM_RXD_ARRIVAL:<br />
AfxMessageBox(msg.lParam);<br />
break;<br />
default:<br />
break;<br />
<br />
};<br />
};<br />
...<br />
and I got the Error MessageBox.
Extreme programming. Do the No.1
|
|
|
|
|
I you cast your datatypes to WPARAM and LPARAM, just cast them back again:-
MSG msg;
while(::GetMessage(&msg, NULL, 0,0))
{
switch(msg.message)
{
case WM_RXD_ARRIVAL:
BYTE* m_pByte = (BYTE *) msg.wParam;
int m_nLen = (int) msg.lParam;
break;
default:
break;
}
}
Thanks
JOn
PS. Have you considered using VB?
Signature space for rent. Apply by email to....
|
|
|
|
|
hi
I want to access a windowsregistry-value. The problem is the value has no name, except for "standard" or "default".
So without a name i can't read the value.
In example :
HKEY_CLASSES_ROOT\http\shell\open\command - the key for the standard-browser.
thanx
|
|
|
|
|
dont send a name for the value u want to read in that case
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
How can I send a e-mail in my mfc application under WinCE?
The ShellExecute function does not exist under WinCE!
I think it works with ShellExecuteEx ?!?
But how to init. the SHELLEXECUTEINFO members ?
Any sample????
|
|
|
|
|
hi,
how to wrap a CALLBACK function into a class?
Thanks in advance.
Extreme programming. Do the No.1
|
|
|
|
|
|
I remember it used #pragmas. I've searched with the above Search box. I've tried Google. I looked in "What's New" all the way back to August. Does anyone know where it is?
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
#pragma message("this is just how to do it")
You could also take a look at my article about compiler messages[^]
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
Thanks! That was the article I was looking for.
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
I want to rename files using wildcards. Any good resource tell me please.
|
|
|
|
|
when I am using waitcommevent() with EV_RXCHAR,It will get twice response.why? I am so...............????*&^*%&%
|
|
|
|
|
Hi Friends,
Can anyone help me in solving this problem. I am able to run my application in Debug mode but not able to run in Release mode.
In my application(MDI application) when I try to open a file it gives "Unreferenced memory 0x000005 - Access Violation" assertion. But, the same is working fine in debug mode.
|
|
|
|
|
Try to build your realease build with debug info.
Gero
|
|
|
|
|
Try adding debugging options to your release configuration so you can track the problem in a debug session:
Compiler: /Zi (if it is an optimizing problem additional try /Od)
Linker: /debug
It is not well known that you can also debug an VC++ app in the "Release Mode" configuration, if you use the above project settings and recompile.
Because MFC and CRT in debug version has many protections against failures sometimes the release version crashes. It is almost a sign for a serious problem in your code even when it dont occur in the debug version. It is a good idea to inspect the debug output (in the debug version) for some warning/diagnostic messages (from MFC/CRT) for getting hints to the problem.
|
|
|
|
|
I have brought a Qtronix Fingerprint mouse and I would like to captrue image from the mouse. But I dont know how to do. Could any one tell me hwo to capture fingerprint image from the mouse?
Million thanks if you could help me!!!!!!!!!!!!
writeln
|
|
|
|
|
That is an external hardware device. So you will need to check with the manufacturer and find out if they provide any API functions or other tools to acquire this information.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
hmm, check to see if it appears as a camera device on your system - if so you could use DirectShow..
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
Thanks all of u!!!
Can I use TWAIN or scanner drvier to get the image??
|
|
|
|
|
How could I override painting of a static control to put some extra text up in top left corner;
_______________
|f1 |
| Static Text |
|______________|
I want the control to draw normally then have my code add the "f1" text in there.
|
|
|
|
|
There are a number of ways that you can accomplish this, however I would recommend subclassing the edit control and overriding the WM_PAINT message.
You can do this by creating a new WndProc for your static control that handles the WM_PAINT message and sends all other messages to the CallWindowProc.
Then call SetWindowLong using the handle to your static control, and set the GWL_WNDPROC parameter. You will need to cache the value that is returned, because this is the value that you will pass into CallWindowProc in order to get the default static control behavior.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|