From: Jaroslav S. <jar...@ya...> - 2001-10-30 10:07:00
|
Hi all! The following simple program lists the contents of the current directory in a combo box. But compiled with MinGW 1.1 it fails on DlgDirListComboBox win32-api call and generates an exception (access violation). Compiled in lcc-win32 it runs correctly. Isn't it a bug in MinGW 1.1? I work on Win2000 and only the basic switches -c -Wall for compiler and -s -mwindows for linker are used. Can anyone help, please? giro ---------------------------- test.c -------------------------------- #include <windows.h> #include "res.h" BOOL MainDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow) { DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, (DLGPROC)MainDlgProc, 0); return 0; } BOOL MainDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_INITDIALOG: MessageBox(hWnd, "aaa", "111", MB_OK); DlgDirListComboBox(hWnd, "*.*", IDC_COMBO, 0, 0); MessageBox(hWnd, "bbb", "222", MB_OK); return TRUE; case WM_CLOSE: EndDialog(hWnd, 0); return TRUE; } return FALSE; } Used resources are: ------------------------------- res.h ------------------------------ #include <windows.h> #define IDD_MAIN 100 #define IDC_COMBO 111 ---------------------------- test.rc ----------------------------- #include "res.h" IDD_MAIN DIALOG 100, 0, 150, 50 STYLE WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Combo box test" FONT 8, "MS Sans Serif" BEGIN COMBOBOX IDC_COMBO, 45, 14, 65, 40, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP END __________________________________________________ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com |