Home > Software engineering >  For help! CMFCShellTreeCtrl display error!
For help! CMFCShellTreeCtrl display error!

Time:11-16

I made a dialog box in the DLL, embeds a CMFCShellTreeCtrl, do nothing, then use this dialog as a modal dialog, but
According to the following:


This is a function of exe calls:

Void OpenDlgSelectDir (const char * prjName, char * re)
{
AFX_MANAGE_STATE (AfxGetStaticModuleState ());
DlgSelectDir DLG.
If (IDOK==DLG. DoModal ())
{
return;
}
}

This is the DLL's code:
#include
BOOL DlgSelectDir: : OnInitDialog ()
{
CDialog: : OnInitDialog ();
//TODO: add additional initialization here
Auto PWND=GetDlgItem (IDC_MFCSHELLTREE1);
PWND CMFCShellTreeCtrl * tree=(CMFCShellTreeCtrl *);
The tree - & gt; SelectPath (" ");
return TRUE;//return TRUE unless you set the focus to a control
//exception: OCX property page should return FALSE
}

Is really a ghost,,
Drew back manually by clicking on the "computer", then click on "the computer", can display properly!
Don't know where is wrong? Ask the great spirit guide!!!!!!

CodePudding user response:

Directly with BrowseForFolder
 
BOOL CMFCDlgApp: : InitInstance ()
{
.
InitShellManager ();

.
}

Void CMFCDlgDlg: : OnBnclickedButton1 ()
{
If (afxShellManager)
{
Cstrings sOut.
AfxShellManager - & gt; BrowseForFolder (sOut, this);

}
}

  • Related