Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Problem with MFC/.NET 2003
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Peter Huang [MSFT]  
View profile  
 More options Jun 26 2003, 9:27 pm
Newsgroups: microsoft.public.vc.mfc
From: v-phu...@online.microsoft.com (Peter Huang [MSFT])
Date: Fri, 27 Jun 2003 01:25:56 GMT
Local: Thurs, Jun 26 2003 9:25 pm
Subject: RE: Problem with MFC/.NET 2003
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()
        //…………
        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" <shis...@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: <OtrCQlrODHA....@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

>I have a problem with MFC/.NET 2003.
>In .NET (2002) I make a new MFC project with MDI named AAA with file
>extension .AAA.
>Build it and run it once, save a file and exit - it registers file type,
and
>now you can click on the file to launch in explorer.
>Do the same with .NET 2003, name it BBB with file extension BBB.
>Now you click on the file you saved, the program runs but no window is ever
>displayed !
>I have reproduced the same problem on several computers, on both W2K and
XP.
>If anybody has any ideas what is going on here, please let me know.

>Thanks and regards.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google