winmeister
asked on
Disabling ShellOpen???
My MFC application accepts opening registered files by double-clicking on them. I need this behaviour, except when a flag is set (bNotAccept=TRUE). In this case no external DDE event should interfere with program execution. How can I handle this?
ASKER
Thui,
your code is executed only during InitIntance. I need to change the behaviour during program execution: at certain point, if the flag goes up, the program should reject all DDE processing.
your code is executed only during InitIntance. I need to change the behaviour during program execution: at certain point, if the flag goes up, the program should reject all DDE processing.
You should then terminate all DDE conversations. There isn't anything in MFC that I know of that automatically responds to DDE commands for you. You need to change your existing DDE code.
ASKER
Actually I don't know which is my "existing DDE code". I just have an EnableShellOpen() command in InitInstance, before file type registration.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdI
return FALSE;
This is the part that parses the DDE interface. If you replace it with
int oldShellCommand = cmdInfo.m_nShellCommand;
if (oldShellCommand == CCommandLineInfo::FileOpen
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNoth
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdI
return FALSE;
Then that should do what you want.