Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you display a dialog from a hidden window application?
    text
    copied!<p>I have developed a COM component (dll) that implements an Edit() method displaying a WTL modal dialog.</p> <p>The complete interface to this COM component corresponds to a software standard used in the chemical process industry (CAPE-OPEN) and as a result this COM component is supposed to be usable by a range of 3rd party executables that are out of my control.</p> <p>My component works as expected in many of these EXEs, but for one in particular the Edit() method just hangs without the dialog appearing.</p> <p>However, if I make a call to <code>::MessageBox()</code> immediately before <code>DoModal()</code> the dialog displays and behaves correctly after first showing the MessageBox.</p> <p>I have a suspicion that the problem may be something to do with this particular EXE running as a 'hidden window application'.</p> <p>I have tried using both NULL and the return value from <code>::GetConsoleWindow()</code> as the dialog's parent, neither have worked.</p> <p>The dialog itself is an ATL/WTL CPropertySheetImpl.</p> <p>The parent application (EXE) in question is out of my control as it is developed by a (mildly hostile) 3rd party.</p> <p>I do know that I can successfully call <code>::MessageBox()</code> or display the standard Windows File Dialog from my COM component, and that after doing so I am then able to display my custom dialog. I'm just unable to display my custom dialog without first displaying a 'standard' dialog.</p> <p>Can anyone suggest how I might get it to display the dialog without first showing an unnecessary MessageBox? I know it is possible because I've seen this EXE display the dialogs from other COM components corresponding to the same interface.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload