HELP: Dialog Is not showing its contents... 
Author Message
 HELP: Dialog Is not showing its contents...

Gurus:

I created a dialog using the visual editor which I intend to use as an
introduction screen to my app. I created a new class for it derived from
CDialog using the class wizard. The problem that I'm having is that when
the program starts, the Introduction dialog shows up (as I want it to)
but its contents are not visible, in other words it shows up as an empty
dialog box. Has anybody ever had this or a similar problem?? Any idea
what might cause it? Thanks in advance!

PS: Here's the code which makes the intro window "shop up" (Courtesy of
Robin...)

BOOL CDelugeDlg::OnInitDialog()
{
        CDialog::OnInitDialog();

        CIntroDialog* m_IntroDlg;                       <<<<<<<    
        m_IntroDlg = new CIntroDialog;                  <<<<<<<
        m_IntroDlg->Create(IDD_INTRO_DIALOG,this);   <<<<<<<
        m_IntroDlg->ShowWindow(SW_SHOW);             <<<<<<<
        Sleep(2000);                                    <<<<<<<
        m_IntroDlg->ShowWindow(SW_HIDE);             <<<<<<<
        m_IntroDlg->DestroyWindow();                 <<<<<<<
        delete m_IntroDlg;                              <<<<<<<
        m_IntroDlg =NULL;                               <<<<<<<
        .
        .
        .
        .

--
Antonio L. Negrn
Mechanical Engineer
Naval Surface Warfare Center, Dahlgren Laboratory
Launcher Systems Branch, Code G21

Phone: (540)-653-2818



Sat, 22 Jun 2002 03:00:00 GMT  
 HELP: Dialog Is not showing its contents...
Antnio, try the splash screen component.
The VC makes the code for you, widthout any problem.

Carlos.



Quote:
> Gurus:

> I created a dialog using the visual editor which I intend to use as an
> introduction screen to my app. I created a new class for it derived from
> CDialog using the class wizard. The problem that I'm having is that when
> the program starts, the Introduction dialog shows up (as I want it to)
> but its contents are not visible, in other words it shows up as an empty
> dialog box. Has anybody ever had this or a similar problem?? Any idea
> what might cause it? Thanks in advance!

> PS: Here's the code which makes the intro window "shop up" (Courtesy of
> Robin...)

> BOOL CDelugeDlg::OnInitDialog()
> {
> CDialog::OnInitDialog();

> CIntroDialog* m_IntroDlg; <<<<<<<
> m_IntroDlg = new CIntroDialog; <<<<<<<
> m_IntroDlg->Create(IDD_INTRO_DIALOG,this); <<<<<<<
> m_IntroDlg->ShowWindow(SW_SHOW); <<<<<<<
> Sleep(2000); <<<<<<<
> m_IntroDlg->ShowWindow(SW_HIDE); <<<<<<<
> m_IntroDlg->DestroyWindow(); <<<<<<<
>     delete m_IntroDlg; <<<<<<<
>     m_IntroDlg =NULL; <<<<<<<
> .
> .
> .
> .

> --
> Antonio L. Negrn
> Mechanical Engineer
> Naval Surface Warfare Center, Dahlgren Laboratory
> Launcher Systems Branch, Code G21

> Phone: (540)-653-2818



Sun, 23 Jun 2002 03:00:00 GMT  
 HELP: Dialog Is not showing its contents...
Ahoy Antonio!

I've gotten empty dialogs, forgetting to set controls as visible, but I
can't imagine you have this problems, as controls added in the resource
editor are visible by default (you could check them anyway). If you are
creating the controls dynamically, however, you might have forgotten to set
the WS_VISIBLE style.

It could be easier to help you if you posted the dialog resource definition
as well as the dialog OnInitDialog (if you have added code to it).

Johan Rosengren
Responsable Informatique
PACTA S.A.



Quote:
> Gurus:

> I created a dialog using the visual editor which I intend to use as an
> introduction screen to my app. I created a new class for it derived from
> CDialog using the class wizard. The problem that I'm having is that when
> the program starts, the Introduction dialog shows up (as I want it to)
> but its contents are not visible, in other words it shows up as an empty
> dialog box. Has anybody ever had this or a similar problem?? Any idea
> what might cause it? Thanks in advance!

> PS: Here's the code which makes the intro window "shop up" (Courtesy of
> Robin...)

> BOOL CDelugeDlg::OnInitDialog()
> {
> CDialog::OnInitDialog();

> CIntroDialog* m_IntroDlg; <<<<<<<
> m_IntroDlg = new CIntroDialog; <<<<<<<
> m_IntroDlg->Create(IDD_INTRO_DIALOG,this); <<<<<<<
> m_IntroDlg->ShowWindow(SW_SHOW); <<<<<<<
> Sleep(2000); <<<<<<<
> m_IntroDlg->ShowWindow(SW_HIDE); <<<<<<<
> m_IntroDlg->DestroyWindow(); <<<<<<<
>     delete m_IntroDlg; <<<<<<<
>     m_IntroDlg =NULL; <<<<<<<
> .
> .
> .
> .

> --
> Antonio L. Negrn
> Mechanical Engineer
> Naval Surface Warfare Center, Dahlgren Laboratory
> Launcher Systems Branch, Code G21

> Phone: (540)-653-2818



Sun, 23 Jun 2002 03:00:00 GMT  
 HELP: Dialog Is not showing its contents...
Antonio,
    What would be more informative is to know what controls are defined on
IDD_INTRO_DIALOG, and what styles they have.


Sun, 23 Jun 2002 03:00:00 GMT  
 HELP: Dialog Is not showing its contents...
OK.. Here's a copy of the files from my project. Hopefully this makes
some sense to you (it definitely doesn't to me!). Sorry, I'm a newbie...
As far as the visibility of the components, I checked them and they are
all visible.

There's ony one component on this dialog and it is a bitmap. I have no
idea why it is not showing. Thanks a lot in advance

PS: I searched the help for slpash screen and nothing showed up. I'm
using VC 5.0...

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<< Contents of IntroDialog.h  >>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

        #if
!defined(AFX_INTRODIALOG_H__41A76F61_BDFC_11D3_8C23_00A0C9EA1FAD__INCLUDED_)
        #define
AFX_INTRODIALOG_H__41A76F61_BDFC_11D3_8C23_00A0C9EA1FAD__INCLUDED_

        #if _MSC_VER >= 1000
        #pragma once
        #endif // _MSC_VER >= 1000
        // IntroDialog.h : header file
        //

/////////////////////////////////////////////////////////////////////////////
        // CIntroDialog dialog

        class CIntroDialog : public CDialog
        {
        // Construction
        public:
                CIntroDialog(CWnd* pParent = NULL);   // standard constructor

        // Dialog Data
                //{{AFX_DATA(CIntroDialog)
                enum { IDD = IDD_INTRO_DIALOG };
                        // NOTE: the ClassWizard will add data members here
                //}}AFX_DATA

        // Overrides
                // ClassWizard generated virtual function overrides
                //{{AFX_VIRTUAL(CIntroDialog)
                protected:
                virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
                //}}AFX_VIRTUAL

        // Implementation
        protected:

                // Generated message map functions
                //{{AFX_MSG(CIntroDialog)
                        // NOTE: the ClassWizard will add member functions here
                //}}AFX_MSG
                DECLARE_MESSAGE_MAP()
        };

        //{{AFX_INSERT_LOCATION}}
        // Microsoft Developer Studio will insert additional declarations
immediately before the previous line.

        #endif //
!defined(AFX_INTRODIALOG_H__41A76F61_BDFC_11D3_8C23_00A0C9EA1FAD__INCLUDED_)

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<< Contents of IntroDialog.cpp  >>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

        // IntroDialog.cpp : implementation file
        //

        #include "stdafx.h"
        #include "deluge.h"
        #include "IntroDialog.h"
        #include "delugeDlg.h"

        #ifdef _DEBUG
        #define new DEBUG_NEW
        #undef THIS_FILE
        static char THIS_FILE[] = __FILE__;
        #endif

/////////////////////////////////////////////////////////////////////////////
        // CIntroDialog dialog

        CIntroDialog::CIntroDialog(CWnd* pParent /*=NULL*/)
                : CDialog(CIntroDialog::IDD, pParent)
        {
                //{{AFX_DATA_INIT(CIntroDialog)
                        // NOTE: the ClassWizard will add member initialization here
                //}}AFX_DATA_INIT
        }

        void CIntroDialog::DoDataExchange(CDataExchange* pDX)
        {
                CDialog::DoDataExchange(pDX);
                //{{AFX_DATA_MAP(CIntroDialog)
                        // NOTE: the ClassWizard will add DDX and DDV calls here
                //}}AFX_DATA_MAP
        }

        BEGIN_MESSAGE_MAP(CIntroDialog, CDialog)
                //{{AFX_MSG_MAP(CIntroDialog)
                        // NOTE: the ClassWizard will add message map macros here
                //}}AFX_MSG_MAP
        END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
        // CIntroDialog message handlers

Quote:

> Gurus:

> I created a dialog using the visual editor which I intend to use as an
> introduction screen to my app. I created a new class for it derived from
> CDialog using the class wizard. The problem that I'm having is that when
> the program starts, the Introduction dialog shows up (as I want it to)
> but its contents are not visible, in other words it shows up as an empty
> dialog box. Has anybody ever had this or a similar problem?? Any idea
> what might cause it? Thanks in advance!

> PS: Here's the code which makes the intro window "shop up" (Courtesy of
> Robin...)

> BOOL CDelugeDlg::OnInitDialog()
> {
>         CDialog::OnInitDialog();

>         CIntroDialog* m_IntroDlg;                       <<<<<<<
>         m_IntroDlg = new CIntroDialog;                  <<<<<<<
>         m_IntroDlg->Create(IDD_INTRO_DIALOG,this);      <<<<<<<
>         m_IntroDlg->ShowWindow(SW_SHOW);                <<<<<<<
>         Sleep(2000);                                    <<<<<<<
>         m_IntroDlg->ShowWindow(SW_HIDE);                <<<<<<<
>         m_IntroDlg->DestroyWindow();                    <<<<<<<
>         delete m_IntroDlg;                              <<<<<<<
>         m_IntroDlg =NULL;                               <<<<<<<
>         .
>         .
>         .
>         .

> --
> Antonio L. Negrn
> Mechanical Engineer
> Naval Surface Warfare Center, Dahlgren Laboratory
> Launcher Systems Branch, Code G21

> Phone: (540)-653-2818

--
Antonio L. Negrn
Mechanical Engineer
Naval Surface Warfare Center, Dahlgren Laboratory
Launcher Systems Branch, Code G21

Phone: (540)-653-2818


Sun, 23 Jun 2002 03:00:00 GMT  
 HELP: Dialog Is not showing its contents...
Antonio!

The real interesting part would have been the resource template from the RC
file (you can open it as text - could you post it here?). And, as the dialog
only contains one control - if you add another control (such as a static
with some text), will the static be visible? Will the bitmap show up when
you edit the dialog in the resource editor? As for the newbie part - don't
we all start there :-)

Johan Rosengren
Responsable Informatique
PACTA S.A.



Quote:
> OK.. Here's a copy of the files from my project. Hopefully this makes
> some sense to you (it definitely doesn't to me!). Sorry, I'm a newbie...
> As far as the visibility of the components, I checked them and they are
> all visible.

<snip>


Mon, 24 Jun 2002 03:00:00 GMT  
 HELP: Dialog Is not showing its contents...
Ah!  The plot thickens!  So, there is only one control on the dialog, and it is a static
control (bitmap)?  I don't see where you told it to display a bitmap, nor what bitmap you
intend to display!

Just look at the menu Project | Add to Project | Components and Controls | Visual C++
Components | Splash Screen.  I think you'll be happy



Mon, 24 Jun 2002 03:00:00 GMT  
 HELP: Dialog Is not showing its contents...
That is exactly what I want to do... BUT... it says in the "more info"
section that "The Splash Screen component will not work in a
dialog-based application" and my app is dialog-based. Anyway, what I'm
trying to do should be simple enough and should be working, right? How
can I solve this problem? I have no idea what could be going on since I
already did what my limited knowledge of MFC allows me to do! HEEELP!!!

PS: Thanks for the replies!

Quote:

> Ah!  The plot thickens!  So, there is only one control on the dialog, and it is a static
> control (bitmap)?  I don't see where you told it to display a bitmap, nor what bitmap you
> intend to display!

> Just look at the menu Project | Add to Project | Components and Controls | Visual C++
> Components | Splash Screen.  I think you'll be happy

--
Antonio L. Negrn
Mechanical Engineer
Naval Surface Warfare Center, Dahlgren Laboratory
Launcher Systems Branch, Code G21

Phone: (540)-653-2818


Mon, 24 Jun 2002 03:00:00 GMT  
 HELP: Dialog Is not showing its contents...
We have now reached Thursday. If you don't fix this by Friday, by all means
send me the project, and I'll take a look during the weekend - I'm sure it
is some trivial thing. Please pack it all with WinZip (or another app making
zip-files), and don't sent the Release and Debug directories, and I'm sure
we will have you sorted out comes Monday.

Johan Rosengren
Responsable Informatique
PACTA S.A.



Quote:
> That is exactly what I want to do... BUT... it says in the "more info"
> section that "The Splash Screen component will not work in a
> dialog-based application" and my app is dialog-based. Anyway, what I'm
> trying to do should be simple enough and should be working, right? How
> can I solve this problem? I have no idea what could be going on since I
> already did what my limited knowledge of MFC allows me to do! HEEELP!!!

> PS: Thanks for the replies!


> > Ah!  The plot thickens!  So, there is only one control on the dialog,
and it is a static
> > control (bitmap)?  I don't see where you told it to display a bitmap,
nor what bitmap you
> > intend to display!

> > Just look at the menu Project | Add to Project | Components and Controls
| Visual C++
> > Components | Splash Screen.  I think you'll be happy

> --
> Antonio L. Negrn
> Mechanical Engineer
> Naval Surface Warfare Center, Dahlgren Laboratory
> Launcher Systems Branch, Code G21

> Phone: (540)-653-2818



Mon, 24 Jun 2002 03:00:00 GMT  
 HELP: Dialog Is not showing its contents...
When I did this, I created a dialog that contained a single static
control (no caption bar), and I did the following:
        (a) created the dialog as a modeless dialog
        (b) dynamically resized the static control to the size of
                the bitmap
        (c) dynamically resized the dialog control to enclose the
                static control
This is a sketch of the key routine for my splashscreen. c_Image is a
CStatic variable (mine was more complex as I had a CStatic that
painted its own picture and did palette management; I've replaced all
that with a SetBitmap call here)

BOOL CSplashScreen::OnInitDialog()
{
        CDialog::OnInitDialog();

        // Use LR_CREATEDIBSECTION to avoid mapping to 16-bit color
        HBITMAP hbmp = (HBITMAP)::LoadImage(AfxGetInstanceHandle(),

MAKEINTRESOURCE(IDB_SMALLSPLASH),
                                            IMAGE_BITMAP,          
                                            0, 0,
                                            LR_CREATEDIBSECTION |  
                                            LR_DEFAULTCOLOR |

LR_SHARED);            
        BITMAP bmpinfo;
        CBitmap * bmp = ::CBitmap::FromHandle(hbmp);
             bmp->GetBitmap(&bmpinfo);
        CRect r(0, 0, bmpinfo.bmWidth, bmpinfo.bmHeight);
        c_Image.SetWindowPos(NULL, 0, 0, r.Width, r.Height(),
                                    SWP_NOZORDER);
        CalcWindowRect(&r);                              
        SetWindowPos(NULL, 0, 0, r.Width(), r.Height(),
                     SWP_NOZORDER | SWP_NOMOVE);    
        CenterWindow(); // recenter now that it is resized        
        c_Image.SetBitmap(bmp);
        GetParent()->EnableWindow(FALSE);            
        EnableWindow(TRUE);                        

        SetTimer(1, TIME_DELTA * 1000, NULL);

        count = 0;

        ::SetFocus(NULL);                    

        return FALSE;  

Quote:
}

On Thu, 06 Jan 2000 09:35:52 -0500, "Antonio L. Negron"

Quote:

>That is exactly what I want to do... BUT... it says in the "more info"
>section that "The Splash Screen component will not work in a
>dialog-based application" and my app is dialog-based. Anyway, what I'm
>trying to do should be simple enough and should be working, right? How
>can I solve this problem? I have no idea what could be going on since I
>already did what my limited knowledge of MFC allows me to do! HEEELP!!!

>PS: Thanks for the replies!


>> Ah!  The plot thickens!  So, there is only one control on the dialog, and it is a static
>> control (bitmap)?  I don't see where you told it to display a bitmap, nor what bitmap you
>> intend to display!

>> Just look at the menu Project | Add to Project | Components and Controls | Visual C++
>> Components | Splash Screen.  I think you'll be happy

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Mon, 24 Jun 2002 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. ActiveX control not showing contents in dialog editor but works fine in application

2. Help me in showing a dialog immediately when main dialog shows

3. UserControl does not show on running form and properies do not show

4. Please help on how to show a help window on clicking a dialog button

5. How to not show task button with a base dialog application

6. I am not able to see my database class members in class view - Please help

7. Not able to show Composite control on dialog or VB Frame

8. Could not show a dialog box with list control from an ATL server exe

9. dialog controls inside groupbox not shown...

10. How to make Dialog not show on Taskbar?

11. ActiveX Control not Showing on Dialog Based Application

12. How to NOT show the Dialog box if program crashes

 

 
Powered by phpBB® Forum Software