Einzelnen Beitrag anzeigen

Mark90
(Gast)

n/a Beiträge
 
#1

Resourcen Dialog Problem

  Alt 6. Okt 2007, 11:30
Hi leute,

ich versuche nun seit mindestens 3 h ein programm zu schreiben das aus einer resource das Hauptfenster(dialog) lädt. leider funzt da irgendwas nicht!

Hier ist mein Hauptprog.

Delphi-Quellcode:

#include <windows.h>
#include "TESTDIALOG.h"

//---------------------------------------------------------------------------
HWND hWnd;
LRESULT CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
//---------------------------------------------------------------------------
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
               LPSTR lpCmdLine, int nCmdShow)
{
   return DialogBox(hInstance, MAKEINTRESOURCE(DLG_0100),
                NULL, (DLGPROC)DlgProc);


}

//---------------------------------------------------------------------------
LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
   switch(Msg)
   {
   case WM_INITDIALOG:
      return TRUE;

   case WM_COMMAND:
      switch(wParam)
      {
      case IDOK:
         EndDialog(hWndDlg, 0);
         return TRUE;
      }

      break;
   }

   return FALSE;
}
//---------------------------------------------------------------------------
und hier ist meine resource.h

Delphi-Quellcode:

#define   DLG_0100   100
und hier ist die resource.rc

Delphi-Quellcode:


DLG_0100 DIALOG 6, 18, 180, 180
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "testdialog"
FONT 8, "Helv"
BEGIN
END
Das Programm wird problemlos compiliert. leider wird mein dialog nicht angezeigt.
  Mit Zitat antworten Zitat