nielsew
asked on
Restoring a CString From a LPARAM
I am trying to pass data between two applications via SendMessage.
I can pass integers back and forth fine, but I am have problems passing any char data.
CWnd* pWnd = CWnd::FromHandle(hWnd);
char *text = "this won't come through"; // doesn't work
int x = 90; // passes fine
pWnd->SendMessage( MY_MESSAGE, (WPARAM) x, (LPARAM), text);
LRESULT CMainFrame::OnExternalMess age(WPARAM wParam, LPARAM lParam)
{
// wParam is OK
CString FileName = (char *) lParam;
// FileName is = "" no good
What am I doing wrong ?
Thanks,
-Eric
I can pass integers back and forth fine, but I am have problems passing any char data.
CWnd* pWnd = CWnd::FromHandle(hWnd);
char *text = "this won't come through"; // doesn't work
int x = 90; // passes fine
pWnd->SendMessage( MY_MESSAGE, (WPARAM) x, (LPARAM), text);
LRESULT CMainFrame::OnExternalMess
{
// wParam is OK
CString FileName = (char *) lParam;
// FileName is = "" no good
What am I doing wrong ?
Thanks,
-Eric
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you! thank you!
I should have posted this question about 3 hours ago!
-Eric
I should have posted this question about 3 hours ago!
-Eric
http://msdn.microsoft.com/library/psdk/winbase/ipc_34o3.htm
Inter-Process Communication Using WM_COPYDATA
http://codeguru.developer.com/win32/ipcdemo.shtml