Click here to Skip to main content
15,922,533 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: what function will convert a char to its number value Pin
Daniel Turini11-Jul-03 23:48
Daniel Turini11-Jul-03 23:48 
GeneralRe: what function will convert a char to its number value Pin
Mike Dimmick12-Jul-03 1:16
Mike Dimmick12-Jul-03 1:16 
AnswerRe: what function will convert a char to its number value Pin
drabudawood13-Jul-03 20:12
drabudawood13-Jul-03 20:12 
QuestionWhy is the constructor protected ? Pin
Shay Harel11-Jul-03 7:25
Shay Harel11-Jul-03 7:25 
AnswerRe: Why is the constructor protected ? Pin
John M. Drescher11-Jul-03 7:40
John M. Drescher11-Jul-03 7:40 
GeneralRe: Why is the constructor protected ? Pin
Shay Harel11-Jul-03 7:43
Shay Harel11-Jul-03 7:43 
GeneralRe: Why is the constructor protected ? Pin
John M. Drescher11-Jul-03 7:50
John M. Drescher11-Jul-03 7:50 
GeneralRe: Why is the constructor protected ? Pin
Shay Harel11-Jul-03 7:52
Shay Harel11-Jul-03 7:52 
GeneralRe: Why is the constructor protected ? Pin
John M. Drescher11-Jul-03 7:55
John M. Drescher11-Jul-03 7:55 
GeneralRe: Why is the constructor protected ? Pin
Anthony_Yio15-Jul-03 1:27
Anthony_Yio15-Jul-03 1:27 
QuestionI don’t’ know how I can find the character set like it? Pin
Alice8011-Jul-03 7:20
Alice8011-Jul-03 7:20 
AnswerRe: I don’t’ know how I can find the character set like it? Pin
Mike Dimmick11-Jul-03 10:02
Mike Dimmick11-Jul-03 10:02 
GeneralRe: I don’t’ know how I can find the character set like it? Pin
Alice8012-Jul-03 1:54
Alice8012-Jul-03 1:54 
GeneralRe: I don’t’ know how I can find the character set like it? Pin
Mike Dimmick12-Jul-03 2:12
Mike Dimmick12-Jul-03 2:12 
AnswerRe: I don’t’ know how I can find the character set like it? Pin
Anthony_Yio15-Jul-03 1:33
Anthony_Yio15-Jul-03 1:33 
GeneralLinked list Pin
DaveE9th11-Jul-03 6:57
DaveE9th11-Jul-03 6:57 
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 

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.