From: derekvv on
A new test was added to dlgcore.cpp in SP1 that breaks the DoModal
call in debugging mode.

In the function CreateDlgIndirect() line 239:

#ifdef _DEBUG
if ( AfxGetApp()->IsKindOf( RUNTIME_CLASS( COleControlModule ) ) )
{
TRACE(traceAppMsg, 0, "Warning: Creating dialog from within a
COleControlModule application is not a supported scenario.\n");
}
#endif

AfxGetApp() returns NULL since there is no parent hence...boom.
Release version works fine since this check is not made.

Is there a way around this to fake a parent or...?

From: Joseph M. Newcomer on
I'd be more concerned that the reason you are getting this error because there is
something wrong with your program. If you are saying that AfxGetApp() returns NULL, this
is indicative of a serious problem. Note that AfxGetApp is not associated with the
concept of parent (go read the code!)

Show your code and give us some more context. You might have been getting away with
something in the past that is now properly diagnosed as an error.
joe
On 28 Mar 2007 09:39:09 -0700, derekvv(a)gmail.com wrote:

>A new test was added to dlgcore.cpp in SP1 that breaks the DoModal
>call in debugging mode.
>
>In the function CreateDlgIndirect() line 239:
>
>#ifdef _DEBUG
> if ( AfxGetApp()->IsKindOf( RUNTIME_CLASS( COleControlModule ) ) )
> {
> TRACE(traceAppMsg, 0, "Warning: Creating dialog from within a
>COleControlModule application is not a supported scenario.\n");
> }
>#endif
>
>AfxGetApp() returns NULL since there is no parent hence...boom.
>Release version works fine since this check is not made.
>
>Is there a way around this to fake a parent or...?
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm