dlg wird durch commctrlelemente nicht angezeigt



  • hallo,

    folgendes problem:
    ich habe einen resourcendialog, der mit einfachen steuerelementen angezeigt wird,
    aber jedoch nicht mit elementen aus der commctrl.h (noch nicht einmal
    initdlg wird aufgerufen..)

    Auch wenn hInstance global verfügbar ist und der dlg ein handle eines richtigen
    fensters erhält klappt es nicht. rather strange. hoffe ihr könnt mir helfen.

    #include <commctrl.h>
    #include "stdafx.h"
    #include "resource.h"
    
    BOOL CALLBACK DialogProc1 (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
    
    int APIENTRY WinMain(HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPSTR     lpCmdLine,
                         int       nCmdShow )
    {
     	return DialogBox (hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DialogProc1);
    }
    
    BOOL CALLBACK DialogProc1 (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
    {
    	switch (message) 
    	{
    		case WM_CLOSE:
    			EndDialog (hDlg,0); 
    			return TRUE;    
    	}
       return  FALSE;
    }
    
    linker: 
    kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Comctl32.lib  
    
    projektobtionen: 
    kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Comctl32.lib /nologo /incremental:yes /pdb:"Debug/oop4.pdb" /debug /machine:I386 /out:"Debug/oop4.exe" /pdbtype:sept
    


  • Du mußt vor der Erstellung des Dialogs noch InitCommonControls/ Ex aufrufen.



  • ahh, schmerz lass nach..

    ich dank dir King 🙂


Anmelden zum Antworten