Click here to Skip to main content
15,925,133 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I'm Confused... Pin
JohnnyG10-Oct-02 9:52
JohnnyG10-Oct-02 9:52 
GeneralRe: I'm Confused... Pin
Gary R. Wheeler10-Oct-02 14:56
Gary R. Wheeler10-Oct-02 14:56 
Generalsplash screen Pin
ns10-Oct-02 7:41
ns10-Oct-02 7:41 
GeneralRe: splash screen Pin
jmkhael10-Oct-02 7:48
jmkhael10-Oct-02 7:48 
GeneralRe: splash screen Pin
ns10-Oct-02 8:05
ns10-Oct-02 8:05 
GeneralRe: splash screen Pin
Stephane Rodriguez.10-Oct-02 8:07
Stephane Rodriguez.10-Oct-02 8:07 
Generalthanks for the link Pin
ns10-Oct-02 8:17
ns10-Oct-02 8:17 
GeneralRe: splash screen Pin
ns10-Oct-02 8:27
ns10-Oct-02 8:27 
Theres a splashscreen.show(0 in oninitdialog, but no .hide(). yet it goes away...stepping takes me into CDialog::DoModal whereabout it vanishes.....I am puzzled. My other modal dlgs never disappear by themselves..yet in the code below it looks like it wil disappear by itself:????

int CDialog::DoModal()
{
	// can be constructed with a resource template or InitModalIndirect
	ASSERT(m_lpszTemplateName != NULL || m_hDialogTemplate != NULL ||
		m_lpDialogTemplate != NULL);

	// load resource as necessary
	LPCDLGTEMPLATE lpDialogTemplate = m_lpDialogTemplate;
	HGLOBAL hDialogTemplate = m_hDialogTemplate;
	HINSTANCE hInst = AfxGetResourceHandle();
	if (m_lpszTemplateName != NULL)
	{
		hInst = AfxFindResourceHandle(m_lpszTemplateName, RT_DIALOG);
		HRSRC hResource = ::FindResource(hInst, m_lpszTemplateName, RT_DIALOG);
		hDialogTemplate = LoadResource(hInst, hResource);
	}
	if (hDialogTemplate != NULL)
		lpDialogTemplate = (LPCDLGTEMPLATE)LockResource(hDialogTemplate);

	// return -1 in case of failure to load the dialog template resource
	if (lpDialogTemplate == NULL)
		return -1;

	// disable parent (before creating dialog)
	HWND hWndParent = PreModal();
	AfxUnhookWindowCreate();
	BOOL bEnableParent = FALSE;
	if (hWndParent != NULL && ::IsWindowEnabled(hWndParent))
	{
		::EnableWindow(hWndParent, FALSE);
		bEnableParent = TRUE;
	}

	TRY
	{
		// create modeless dialog
		AfxHookWindowCreate(this);
		if (CreateDlgIndirect(lpDialogTemplate,
						CWnd::FromHandle(hWndParent), hInst))
		{
			if (m_nFlags & WF_CONTINUEMODAL)
			{
				// enter modal loop
				DWORD dwFlags = MLF_SHOWONIDLE;
				if (GetStyle() & DS_NOIDLEMSG)
					dwFlags |= MLF_NOIDLEMSG;
				VERIFY(RunModalLoop(dwFlags) == m_nModalResult);
			}

			// hide the window before enabling the parent, etc.
			if (m_hWnd != NULL)
				SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW|
					SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);
		}
	}
	CATCH_ALL(e)
	{
		DELETE_EXCEPTION(e);
		m_nModalResult = -1;
	}
	END_CATCH_ALL

	if (bEnableParent)
		::EnableWindow(hWndParent, TRUE);
	if (hWndParent != NULL && ::GetActiveWindow() == m_hWnd)
		::SetActiveWindow(hWndParent);

	// destroy modal window
	DestroyWindow();
	PostModal();

	// unlock/free resources as necessary
	if (m_lpszTemplateName != NULL || m_hDialogTemplate != NULL)
		UnlockResource(hDialogTemplate);
	if (m_lpszTemplateName != NULL)
		FreeResource(hDialogTemplate);

	return m_nModalResult;
}


In this line:
// destroy modal window<br />
	DestroyWindow();<br />
it looks like it goes away by itself (any modal window)...Confused | :confused: Confused | :confused:

Appreciate your help,
ns
GeneralRe: splash screen Pin
jmkhael10-Oct-02 8:31
jmkhael10-Oct-02 8:31 
GeneralRe: splash screen Pin
ns10-Oct-02 8:39
ns10-Oct-02 8:39 
GeneralRe: splash screen Pin
Shog910-Oct-02 8:53
sitebuilderShog910-Oct-02 8:53 
GeneralRe: splash screen Pin
ns10-Oct-02 8:59
ns10-Oct-02 8:59 
GeneralRe: splash screen Pin
Carlos Antollini10-Oct-02 7:58
Carlos Antollini10-Oct-02 7:58 
Questionhow many instances of the same file can be opened simultaneously Pin
tomc10-Oct-02 6:55
tomc10-Oct-02 6:55 
AnswerRe: how many instances of the same file can be opened simultaneously Pin
Gary R. Wheeler10-Oct-02 15:01
Gary R. Wheeler10-Oct-02 15:01 
GeneralCArray::IsEmpty() Pin
lucy10-Oct-02 6:42
lucy10-Oct-02 6:42 
GeneralRe: CArray::IsEmpty() Pin
jmkhael10-Oct-02 6:47
jmkhael10-Oct-02 6:47 
GeneralRe: CArray::IsEmpty() Pin
lucy10-Oct-02 6:48
lucy10-Oct-02 6:48 
GeneralRe: CArray::IsEmpty() Pin
jmkhael10-Oct-02 7:03
jmkhael10-Oct-02 7:03 
GeneralRe: CArray::IsEmpty() Pin
lucy10-Oct-02 7:05
lucy10-Oct-02 7:05 
GeneralRe: CArray::IsEmpty() Pin
Bartosz Bien10-Oct-02 9:55
Bartosz Bien10-Oct-02 9:55 
GeneralAutomating Excel without MFC Pin
Giles10-Oct-02 6:22
Giles10-Oct-02 6:22 
GeneralRe: Automating Excel without MFC Pin
Nick Parker10-Oct-02 6:36
protectorNick Parker10-Oct-02 6:36 
GeneralRe: Automating Excel without MFC Pin
Giles10-Oct-02 7:48
Giles10-Oct-02 7:48 
GeneralRe: Automating Excel without MFC Pin
Stephane Rodriguez.10-Oct-02 7:46
Stephane Rodriguez.10-Oct-02 7:46 

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.