Dialog in SDI anzeigen



  • HI

    ich will einen selber erstellten Dialog in meiner SDI anzeigen! Klappt aber nicht ich have versucht:

    CDialog1 Dlg;
    Dlg.DoModal();
    //klappt aber nicht, denke habe das was mit den Variablen falschgemacht????

    andrere Möglichkeit:

    CDialog1 *m_pDialog;
    m_pDialog= new CDialog1;
    m_pDialog->Create(IDD_DIALOG1, this);
    m_pDialog->ShowWindow(SW_SHOW);
    Klappt auch nicht keine Ahung wieso?????????

    NAja werden keine Fehler angezeigt aber auch kein Dialog ⚠



  • hi

    ich hab leider immer nochn nicht geschafft. 😞

    versuche weiter , aber wäre schon super wenn mir einer auch nur ne Richtung geben kömmte!

    damke auf jedenfall schon einmal



  • Hallo,

    Die Klasse CDialog1 hast du von CDialog abgeleitet oder?

    Wie hast du die Klasse egentlich erstelt???

    MFG TacooGo



  • Andreas Bäcker schrieb:

    CDialog1 *m_pDialog;
    m_pDialog= new CDialog1;
    m_pDialog->Create(IDD_DIALOG1, this);
    m_pDialog->ShowWindow(SW_SHOW);

    m_poDieserDlg = new CDieserDialog();
      m_poProduktDlg->DoModal();
      delete m_poDieserDlg;
      m_poDieserDlg = 0;
    

    so machst dus, wenn du eine grafische ressource hast.
    manuell ueber create hab ichs noch nicht gemacht. aber in der msdn steht folgendes:
    [msdn]
    Use the WS_VISIBLE style in the dialog-box template if the dialog box should appear when the parent window is created. Otherwise, you must call ShowWindow. For further dialog-box styles and their application, see theDLGTEMPLATE structure in the Win32 SDK documentation and Window Styles in the Class Library Reference.
    [/msdn]
    du musst deinem dialog ja auch eine grösse etc zuweisen. das hast du ja in obigem bsp nicht gemacht. somit kann er eig. auch nix anzeigen.

    Esco



  • [quote="TaccoGo"]Hallo,

    Die Klasse CDialog1 hast du von CDialog abgeleitet oder?

    Wie hast du die Klasse egentlich erstelt???

    danke für die Antwort habe die Klasse einmal als CDialog und einmal also "formDialof oder so ähnlich angelet, weil ich das in der Msdn so gelesen hatte.

    Aber gerade da liegt irgendwo der Fehler.



  • CDialog oder CFormView? Schau mal in den Header.



  • Hallo,

    dein aufruf scheit ja ganz inordnug zu sein

    CDialog1 Dlg; 
    Dlg.DoModal();
    

    was meinst du den mit formDialog?

    ich meine das so.

    class CAboutDlg : public CDialog
    {
    public:
    ...
    };
    

    MFG TaccoGo


Anmelden zum Antworten