Registered File Association no longer working in MFC App after porting to 64 bits?

John Wilk 0 Reputation points
2023-02-02T17:41:07.6666667+00:00

Our application has stopped working when a user double clicks on a data file that has been registered with the shell. When the user double clicks the data file the application is still opened by windows and the '/dde' command line argument is received, but no WMDDE messages are received. I'm expecting and had been recieving a WMDDE_EXECUTE message with the file path and name.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,579 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,519 questions
{count} votes

2 answers

Sort by: Most helpful
  1. RLWA32 40,021 Reputation points
    2023-02-03T09:02:33.9433333+00:00

    A general observation is that failures to connect with a started DDE server process are often caused by the manner in which the WaitForInputIdle function determines that the DDE server process is ready for communication to begin. Basically, the DDE Server process has done something during startup to cause WaitForInputIdle to believe that it has gone input idle before it can process DDE messages.

    Raymond Chen's blog contains a number of articles about this issue. For example,

    Psychic debugging: Understanding DDE initiation

    WaitForInputIdle should really be called WaitForProcessStartupComplete

    WaitForInputIdle waits for any thread, which might not be the thread you care about

    Once you go input-idle, your application is deemed ready to receive DDE messages

    On the importance of making sure WaitForInputIdle doesn’t think you’re idle, episode 1

    On the importance of making sure WaitForInputIdle doesn’t think you’re idle, episode 2

    0 comments No comments

  2. John Wilk 0 Reputation points
    2023-02-10T16:29:44.1766667+00:00

    Finally figured out the answer and it is, "sort of", a 32-64 bit issue. When run from anywhere but the "C:\Program Files (x86)" directory DDE wont work, at least not for opening a registered file when the application itself hasn't already been opened. When placed in the C:\Program Files (x86) directory, it does work correctly.

    0 comments No comments