There is a problem while overriding WM_COPYDATA, it only copies the base address
Code:
//Source Application
COPYDATASTRUCT cpd, cpdProjectName, cpdTitleReportName;
UINT wind;
MYDATASTRUCT myStringData;
WTL::CString strDataToSend = L"4012";
CComBSTR localStr(strDataToSend);
cpd.dwData = 0; // arbitatry long data to send
cpd.lpData = localStr.m_str; // a pointer to the buffer containing
// data to send
cpd.cbData = localStr.ByteLength()+1;
copyDataResult = ::SendMessage(pOtherWnd, WM_COPYDATA, (WPARAM)::GetWindowContextHelpId(pOtherWnd), (LPARAM)&cpd);
::SendMessage(pOtherWnd, WM_COPYDATA, (WPARAM)0, (LPARAM) (LPVOID)&cpd);c
copyDataResult = ::SendMessage(pOtherWnd, WM_COPYDATA, (WPARAM)(HWND)pOtherWnd, (LPARAM) (LPVOID)&cpd);
Code:
//Destination Application
LONG CTrendProjectDlg::OnCopyData(UINT wind, LONG cpdL)
{
COPYDATASTRUCT *cpdP;
long retVal;
cpdP = (COPYDATASTRUCT*)cpdL;
m_RxData = (LPCSTR)(cpdP->lpData);
double wcstod( const wchar_t *nptr, wchar_t **endptr );
dCCCompleted = wcstod(m_RxData, NULL);
CWnd *pRxData = GetDlgItem(IDC_ED_RXDATA);
pRxData->SetWindowText(m_RxData);
retVal = 0;
return (retVal); // return value will be seen bu 32-bit app.
}
Can some help me in resolving this?