Click here to Skip to main content
16,004,833 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Namedpipe Pin
Mark Salsbery18-Jul-07 6:19
Mark Salsbery18-Jul-07 6:19 
GeneralRe: Namedpipe Pin
charian092018-Jul-07 14:57
charian092018-Jul-07 14:57 
QuestionWhat happens after OnInitDialog()? Pin
rp_suman17-Jul-07 22:41
rp_suman17-Jul-07 22:41 
AnswerRe: What happens after OnInitDialog()? Pin
Cedric Moonen17-Jul-07 22:49
Cedric Moonen17-Jul-07 22:49 
AnswerRe: What happens after OnInitDialog()? Pin
Nibu babu thomas18-Jul-07 1:15
Nibu babu thomas18-Jul-07 1:15 
QuestionModifying the Windows Explorer Statusbar Pin
Toadflakz_UK17-Jul-07 22:14
Toadflakz_UK17-Jul-07 22:14 
QuestionHow to make first dialog iitself in a dialog based application Modeless Pin
robshere17-Jul-07 20:52
robshere17-Jul-07 20:52 
AnswerRe: How to make first dialog iitself in a dialog based application Modeless Pin
Arman S.17-Jul-07 21:35
Arman S.17-Jul-07 21:35 
What is your puropse of doing that? Making the dialog [from a dialog-based app] be modeless is meaningless unless you specify the aim.

Anyway, if you look at the InitInstance method, you will see that this method will not return until CMyDlg::DoModal returns. Note that the application will exit if the InitInstance exits in a dialog based app. So if your dlg were modeless you'd not do much for him as the app would exit just after the dlg displayed.

Still you may simulate smth like what you want. The code in InitInstance might look like so;

CMyDlg *pDlg = new CMyDlg();
pDlg->Create(CMyDlg::IDD, NULL);
// you may use CWnd::GetDesktopWindow() instead of NULL if it make sense

pDlg->ShowWindow(SW_SHOW);

CWinThread::Run();


// Here CWinThread::Run enters a message loop and thus will prevent the app exit instantly.


The only remaining point was to exit the app when the dialog closed. So you should have PostQuitMessage inside CMyDlg::PostNcDestroy;

PostQuitMessage(0);
delete this;


Once again, these all are note a good practice...



--
=====
Arman

GeneralRe: How to make first dialog iitself in a dialog based application Modeless Pin
Adrian Brutus17-Jul-07 22:08
Adrian Brutus17-Jul-07 22:08 
GeneralRe: How to make first dialog iitself in a dialog based application Modeless Pin
Arman S.17-Jul-07 22:33
Arman S.17-Jul-07 22:33 
QuestionRe: How to make first dialog iitself in a dialog based application Modeless Pin
robshere17-Jul-07 22:15
robshere17-Jul-07 22:15 
AnswerRe: How to make first dialog iitself in a dialog based application Modeless Pin
Arman S.17-Jul-07 22:43
Arman S.17-Jul-07 22:43 
GeneralRe: How to make first dialog iitself in a dialog based application Modeless Pin
robshere17-Jul-07 22:59
robshere17-Jul-07 22:59 
GeneralRe: How to make first dialog iitself in a dialog based application Modeless Pin
David Crow18-Jul-07 2:49
David Crow18-Jul-07 2:49 
GeneralRe: How to make first dialog iitself in a dialog based application Modeless Pin
robshere18-Jul-07 3:17
robshere18-Jul-07 3:17 
GeneralRe: How to make first dialog iitself in a dialog based application Modeless Pin
David Crow18-Jul-07 3:39
David Crow18-Jul-07 3:39 
QuestionConvert ActiveX DLL to ActiveX EXE. Pin
Anand Todkar17-Jul-07 20:30
Anand Todkar17-Jul-07 20:30 
AnswerRe: Convert ActiveX DLL to ActiveX EXE. Pin
Cedric Moonen17-Jul-07 20:44
Cedric Moonen17-Jul-07 20:44 
GeneralRe: Convert ActiveX DLL to ActiveX EXE. Pin
Anand Todkar17-Jul-07 21:07
Anand Todkar17-Jul-07 21:07 
GeneralRe: Convert ActiveX DLL to ActiveX EXE. Pin
Cedric Moonen17-Jul-07 21:09
Cedric Moonen17-Jul-07 21:09 
GeneralRe: Convert ActiveX DLL to ActiveX EXE. Pin
Anand Todkar17-Jul-07 21:16
Anand Todkar17-Jul-07 21:16 
GeneralRe: Convert ActiveX DLL to ActiveX EXE. Pin
Cedric Moonen17-Jul-07 21:22
Cedric Moonen17-Jul-07 21:22 
GeneralRe: Convert ActiveX DLL to ActiveX EXE. Pin
Anand Todkar17-Jul-07 21:28
Anand Todkar17-Jul-07 21:28 
Questionshelp relating to shell Pin
Chandrasekharan P17-Jul-07 20:08
Chandrasekharan P17-Jul-07 20:08 
QuestionRe: shelp relating to shell Pin
Perspx17-Jul-07 20:10
Perspx17-Jul-07 20:10 

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.