Nichtmodales Fenster in einer DLL



  • Wie erstelle ich ein nichtmodales Fenster in einer DLL ?

    Es kommt bei mir bei "ShowWindow(SW_NORMAL);" folgende Fehlermeldung
    _______________________________________________________
    Debug Assertion Failed!
    Programm : C:\...\Project1.exe
    File : winocc.cpp
    Line 301

    For Information on how your program can cause assertion
    failure, see the Visual C++ documentation on asserts.
    _________________________________________________________

    Danke
    Gruss
    Alex



  • Microsoft schrieb:

    // winocc.cpp
    BOOL CWnd::ShowWindow(int nCmdShow)
    {
      ASSERT(::IsWindow(m_hWnd)); // <-- line 301
    

    Microsoft schrieb:

    The IsWindow function determines whether the specified window handle identifies an existing window.



  • Und was soll mir das sagen ???

    Sorry für Anfänger-Fragen 😞



  • Dein fenster existiert nicht. Da läuft schon vorher was falsch, beim create.



  • in einer Funktion :

    MyWindow* mywnd = new MyWindow;
    

    Konstruktor von MyWindow :

    MyWindow::MyWindow()
    {
    	const RECT myRect;
    	CWnd::Create("CWnd", "TEST", WS_MAXIMIZE, myRect, NULL, 1, NULL);
    	CWnd::ShowWindow(SW_SHOWMAXIMIZED);
    }
    

    Jetzt kommt der Fehler hier :

    ASSERT(pParentWnd != NULL);
    

    Bedeutet vermutlich dass ein Parent existiert obwohl ich den im Create als NULL angegeben habe.
    Der Parent ist in einem Java-Programm, welches die DLL benutzt, wie komme ich denn da dran ?

    Danke
    Gruss
    Alex



  • Habe das MyWindow von CFrameWnd abgeleitet, jetzt scheint es zu funktionieren 🙂


Anmelden zum Antworten