Home > Software engineering >  Why don't show out the window? CSkinDialog problem
Why don't show out the window? CSkinDialog problem

Time:10-01

In succession CWinApp rewrite the InitInstance ();

There are two code;

 
//build windowCPlatformFrame * pPlatformFrame=new CPlatformFrame;
PPlatformFrame - & gt; Create (IDD_PLATFORM_FRAME, NULL);


CPlatformFrame is inherited CSkinDialog

In CPlatformFrame constructor is
 
//constructorCPlatformFrame: : CPlatformFrame () : CSkinDialog (IDD_PLATFORM_FRAME)
{
//set the variable
M_bLogonSuccess=false;
M_nSelectItem=1;

//task component
M_MissionManager. InsertMissionItem (& amp; M_MissionList);
M_MissionManager. InsertMissionItem (& amp; M_MissionLogon);
M_MissionManager. InsertMissionItem (& amp; M_MissionAndroid);

//platform variable
ASSERT (m_pPlatformFrame==NULL);
If (m_pPlatformFrame==NULL) m_pPlatformFrame=this;

//create a brush
M_brBackGround. CreateSolidBrush (RGB (215223228));
return ;
}


In CPlatformFrame OnInitDialog (rewrite) is the code like this:
 
//initial windowBOOL CPlatformFrame: : OnInitDialog ()
{
__super: : OnInitDialog ();

//Settings window
ModifyStyle (WS_CAPTION | WS_MAXIMIZE | WS_MINIMIZE, WS_MINIMIZEBOX | WS_MAXIMIZEBOX);

//Settings icon
HINSTANCE HINSTANCE=AfxGetInstanceHandle ();
SetIcon (LoadIcon (hInstance, MAKEINTRESOURCE (IDR_MAINFRAME)), TRUE);
SetIcon (LoadIcon (hInstance, MAKEINTRESOURCE (IDR_MAINFRAME)), FALSE);

//set the title
SetWindowText (TEXT (" robot manager "));

//set the interface
M_MissionAndroid. SetAndroidOperateCenter (this);

//set the callback
CServerListData: : GetInstance () - & gt; SetServerListDataSink (this);

//the initial control
InitControls ();

//register event
CPlatformEvent * pPlatformEvent=CPlatformEvent: : GetInstance ();
If (pPlatformEvent!=NULL) pPlatformEvent - & gt; RegisterEventWnd (m_hWnd);

//login system
PostMessage (WM_COMMAND, IDM_USER_LOGON, 0);

Return TRUE;
}


And then this program run without fault, is anyway show not to come out interface
  • Related