I created a simple MDI application. Program , Use. BSF (custom document extension) as its document I save a foo. BSF document, you can double-click the file in resource manager to open the MDI Application and open Foo. BSF documentation. however, after I add the tip of the day component to the MDI application, double-click Foo. after BSF, I will be given a warning: assert (: iswindow (m_hwnd), and then the MDI application will die.
When you start an application from DDE (for example, double-click the relevant documentation), "Tip of the Day" has a bug. you can look at the function "showtipatstartup", which is called in "initinstance". You can see that the tip of the day is displayed as a mode dialog box, when processing other messages, it always performs a message loop. You can change showtipatstartup to prevent tip of the day from being started from DDE.
Void ctipofapp: showtipatstartup (void)
{
// CG: This function added by 'tip of the day' component.
Ccommandlineinfo using info;
Parsecommandline (partition info );
If (
Using info. m_bshowsplash &&
Raise info. m_nshellcommand! = Ccommandlineinfo: filedde
)
{
Ctipdlg DLG;
If (DLG. m_bstartup)
DLG. domodal ();
}
}
If there are other bugs, you can set the filters for the cmdinfo. m_nshellcommand.