Click here to Skip to main content
15,905,682 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Linked list Pin
David Crow11-Jul-03 7:06
David Crow11-Jul-03 7:06 
GeneralRe: Linked list Pin
DaveE9th12-Jul-03 2:24
DaveE9th12-Jul-03 2:24 
GeneralRe: Linked list Pin
John M. Drescher11-Jul-03 7:20
John M. Drescher11-Jul-03 7:20 
GeneralRe: Linked list Pin
DaveE9th11-Jul-03 8:24
DaveE9th11-Jul-03 8:24 
GeneralRe: Linked list Pin
DaveE9th11-Jul-03 20:34
DaveE9th11-Jul-03 20:34 
GeneralProperty Pages question Pin
skinnyreptile11-Jul-03 6:34
skinnyreptile11-Jul-03 6:34 
GeneralRe: Property Pages question Pin
David Crow11-Jul-03 7:14
David Crow11-Jul-03 7:14 
GeneralOpen modeless Dialog from a DLL Pin
Mathias S.11-Jul-03 6:09
Mathias S.11-Jul-03 6:09 
I want to open a modeless dialog from a DLL.
The DLL is a MFC DLL and contains a CWinApp

In the DLL this code is run to create the dialog
void CShowDlg::Show()
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	CMyDlg* pDlg = new CMyDlg();
	CMyDlg->Create( IDD_MYDLG , NULL );
	CMyDlg->ModifyStyleEx( 0 , WS_EX_APPWINDOW );
	CMyDlg->ShowWindow( SW_SHOW );
}
It Works. But the dialog is ALWAYS on top the main app. Since this dialog can be rater big it’s not good.

But if I comment out the creations of the CWinApp.
// CMyDlgDll theApp;

The dialog acts like any other window and can be sent to back and so.
But Then I get some other problem.

Some places in the code in the DLL is running CWaitCursor, and it is calling AfxGetApp();
Which returns NULL since theApp it out commented.

The only solution I found was to keep the CWinApp ( theApp ) and then create a new thread ( CWinThread ) and let that thread create the dialog.

Now everything works. But I got 2 extra thread just to open the dialog. And I think that one should be enough. or ?

Anyone have any ides/tips ?
GeneralMaximum Window size Pin
pankajdaga11-Jul-03 6:03
pankajdaga11-Jul-03 6:03 
GeneralRe: Maximum Window size Pin
KaЯl11-Jul-03 12:30
KaЯl11-Jul-03 12:30 
GeneralAccessing USB port Pin
Jonathan Gilligan11-Jul-03 6:02
Jonathan Gilligan11-Jul-03 6:02 
GeneralRe: Accessing USB port Pin
valikac11-Jul-03 6:27
valikac11-Jul-03 6:27 
GeneralRe: Accessing USB port Pin
Jonathan Gilligan11-Jul-03 6:40
Jonathan Gilligan11-Jul-03 6:40 
GeneralAdding toolbar to Visual C++ IDE Pin
Anonymous11-Jul-03 6:02
Anonymous11-Jul-03 6:02 
Generalreverse inet_ntoa Pin
RobJones11-Jul-03 5:25
RobJones11-Jul-03 5:25 
GeneralRe: reverse inet_ntoa Pin
Ryan Binns11-Jul-03 5:30
Ryan Binns11-Jul-03 5:30 
GeneralRe: reverse inet_ntoa Pin
RobJones11-Jul-03 5:37
RobJones11-Jul-03 5:37 
GeneralRe: reverse inet_ntoa Pin
Ryan Binns11-Jul-03 5:41
Ryan Binns11-Jul-03 5:41 
GeneralSSH Pin
Brian Delahunty11-Jul-03 5:18
Brian Delahunty11-Jul-03 5:18 
GeneralRe: SSH Pin
Jonathan Gilligan11-Jul-03 6:41
Jonathan Gilligan11-Jul-03 6:41 
GeneralRe: SSH Pin
Brian Delahunty12-Jul-03 22:31
Brian Delahunty12-Jul-03 22:31 
QuestionScreensaver install? Pin
SIerus11-Jul-03 4:05
SIerus11-Jul-03 4:05 
AnswerRe: Screensaver install? Pin
Ryan Binns11-Jul-03 4:42
Ryan Binns11-Jul-03 4:42 
GeneralRe: Screensaver install? Pin
SIerus11-Jul-03 4:50
SIerus11-Jul-03 4:50 
GeneralRe: Screensaver install? Pin
Ryan Binns11-Jul-03 4:55
Ryan Binns11-Jul-03 4:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.