Link to home
Start Free TrialLog in
Avatar of nielsew
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::OnExternalMessage(WPARAM wParam, LPARAM lParam)
{

   // wParam is OK
   
    CString FileName = (char *) lParam;
   
  //   FileName  is  = ""  no good


What am I doing wrong ?

Thanks,

-Eric
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nielsew
nielsew

ASKER

thank you! thank you!

I should have posted this question about 3 hours ago!

-Eric