Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I avoided to use WinProc..Instead of that I wrote a normal function(CopyData) in the class Dialog11..Created a modeless dialog in the class CCopyDialog1.. and called that function(CopyData)..It worked..Please check the below code...</p> <pre><code>//CCopyDialog Class(sender) void CCopyDataDlg::OnBnClickedOk() { // TODO: Add your control notification handler code here Dialog1* dialog1 = new Dialog1(); dialog1-&gt;Create(IDD_DIALOG1,0); dialog1-&gt;ShowWindow(SW_SHOW); ZeroMemory(&amp;myData,sizeof(myData)); wcscpy(myData.mydata,(L"Rakesh")); cData.dwData = ORGININFO; cData.cbData = sizeof(myData); cData.lpData = &amp;myData; HWND rs = ::FindWindow(NULL,L"Rakesh"); dialog1-&gt;CopyData(WM_COPYDATA,(WPARAM)rs,(LPARAM)&amp;cData); } Dialog1 class(receiver) LRESULT Dialog1::CopyData(UINT message,WPARAM wParam,LPARAM lparam) { if(message == WM_COPYDATA) { pData = (PCOPYDATASTRUCT)lparam; wchar_t tes[50]; memcpy(tes,((DATA*)(pData-&gt;lpData))-&gt;myData,sizeof(DATA)); } else { return FALSE; } return 0; } </code></pre> <p>Basically when compared to my previous code(code in my question)...theres lot of difference/mistakes..</p> <p>1.In the sendmessage i passed the structure instead of COPYDATASTRUCT.. 2.Called FindWindow before calling the Dialog1 window.. 3.Used the function WinProc function to receive the message..which was very hard to make it work..then avoided that and used a normal function 4.Didnt pass a proper window handle... the above all are corrected by Bob Moore...credit goes to him....</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload