-
August 12th, 2001, 02:24 AM
#1
PostMessage
Why error when I call the PostMessage?
Below is my code at DLL.
extern "C" __declspec( dllexport ) int CallApp()
{
COPYDATASTRUCT cds;
cds.dwData = 1;
cds.lpData = (LPVOID)(LPCTSTR)"DLL FuncCall";
cds.cbData = 5;
HWND hwnd = FindWindow(NULL,"AppService");
if(hwnd)
{
if(!PostMessage(hwnd,WM_COPYDATA,(WPARAM)NULL,(LPARAM)&cds))
{
DWORD dwErr = GetLastError();
MessageBox(NULL,"PostMessage ERROR","EnvoxDLL ALERT",MB_OK);
}
}
else MessageBox(NULL,"NO APP","EnvoxDLL ALERT",MB_OK);
return 0;
}
Best Regards
alan
2001/4/20
-
August 12th, 2001, 02:26 AM
#2
Re: PostMessage
What is the value returned by GetLastError?
-
August 12th, 2001, 03:42 AM
#3
Re: PostMessage
You cannot use PostMessage with WM_COPYDATA message. Use SendMessage instead.
Best regards. Alex.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|