Thanks and regards.
I have performed researched and found that it is a known issue. I would
like to provide you with the following workaround.
1. Insert the following codes at the head of your MainFrm.cpp.
#include <dde.h> // for DDE execute shell requests
#ifndef _countof
#define _countof(array) (sizeof(array)/sizeof(array[0]))
#endif
2. Revise the message map in your MainFrm.cpp.
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
ON_WM_CREATE()
//…………
ON_MESSAGE(WM_DDE_EXECUTE, OnDDEExecute)
END_MESSAGE_MAP()
3. In your MainFrm.h file, insert the following codes
protected:
afx_msg LRESULT OnDDEExecute(WPARAM wParam, LPARAM lParam);
4. Insert the following code in your MainFrm.cpp file
LRESULT CMainFrame::OnDDEExecute(WPARAM wParam, LPARAM lParam)
{
// unpack the DDE message
UINT_PTR unused;
HGLOBAL hData;
//IA64: Assume DDE LPARAMs are still 32-bit
VERIFY(UnpackDDElParam(WM_DDE_EXECUTE, lParam, &unused,
(UINT_PTR*)&hData));
// get the command string
TCHAR szCommand[_MAX_PATH * 2];
LPCTSTR lpsz = (LPCTSTR)GlobalLock(hData);
lstrcpyn(szCommand, lpsz, _countof(szCommand));
GlobalUnlock(hData);
// acknowledge now - before attempting to execute
::PostMessage((HWND)wParam, WM_DDE_ACK, (WPARAM)m_hWnd,
//IA64: Assume DDE LPARAMs are still 32-bit
ReuseDDElParam(lParam, WM_DDE_EXECUTE, WM_DDE_ACK,
(UINT)0x8000, (UINT_PTR)hData));
// don't execute the command when the window is disabled
if (!IsWindowEnabled())
{
TRACE(traceAppMsg, 0, _T("Warning: DDE command '%s' ignored because
window is disabled.\n"),
szCommand);
return 0;
}
// execute the command
if (!AfxGetApp()->OnDDECommand(szCommand))
TRACE(traceAppMsg, 0, _T("Error: failed to execute DDE command '%s'.\n"),
szCommand);
return 0L;
}
Please perform the steps above and let me know if they are successful.
Thank you for your time.
Regards,
Peter Huang
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "shisley" <shi...@pacbell.net>
>Subject: Problem with MFC/.NET 2003
>Date: Tue, 24 Jun 2003 18:35:34 -0700
>Lines: 14
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Message-ID: <OtrCQlr...@TK2MSFTNGP10.phx.gbl>
>Newsgroups: microsoft.public.vc.mfc
>NNTP-Posting-Host: adsl-66-121-254-34.dsl.lsan03.pacbell.net 66.121.254.34
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.vc.mfc:380187
>X-Tomcat-NG: microsoft.public.vc.mfc
mp
"Peter Huang [MSFT]" <v-ph...@online.microsoft.com> wrote in message
news:yRPGhsEP...@cpmsftngxa06.phx.gbl...
> Hi Shisley,
>
> I have performed researched and found that it is a known issue. I would
> like to provide you with the following workaround.
>
> 1. Insert the following codes at the head of your MainFrm.cpp.
> #include <dde.h> // for DDE execute shell requests
> #ifndef _countof
> #define _countof(array) (sizeof(array)/sizeof(array[0]))
> #endif
>
> 2. Revise the message map in your MainFrm.cpp.
> BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
> ON_WM_CREATE()
> //....