Hi, I want to be able to send a pointer pointing to the following struct:
to another applications window.
I've tried the following:
The other application receives the message ok, but the pointer seems to be corrupted, heres an example for the other application:
Once you try calling info->Number1 the application freezes.
Hope that makes sence and help would be appricated, thanks in advance...
Code:
struct MyStruct
{
int Number1;
int Number2;
};
to another applications window.
I've tried the following:
Code:
MyStruct * info=new MyStruct;
info->Number1=100;
info->Number2=200;
::SendMessage(m_hTargetWindow,WM_APP+1,0,(LPARAM)info);
delete info;
The other application receives the message ok, but the pointer seems to be corrupted, heres an example for the other application:
Code:
void CMainWindow::OnReceiveInfo(WPARAM wParam, LPARAM lParam)
{
MyStruct * info=(MyStruct*)lParam;
if (info->Number1==100) AfxMessageBox("here");
}
Once you try calling info->Number1 the application freezes.
Hope that makes sence and help would be appricated, thanks in advance...