I'm using DlgDirListComboBox(), to try and get files listed in my dialogs combo box.
this is the code for it,
the problem is the files aren't showing, also when I used dhwnd instaed of (HWND)IDD_DIALOG1, for the dialogs handle, a mwmory error message came upCode:BOOL CALLBACK DlgProc(HWND dhwnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch(Message) { case WM_INITDIALOG: char *filelist; filelist = (char*)GlobalAlloc(GPTR,5); filelist = "*.bmp"; DlgDirListComboBox((HWND)IDD_DIALOG1,//dialog's HWND? filelist,//just bmp's from current dir IDC_COMBO1,//combo box 0, DDL_READWRITE); return FALSE; case WM_COMMAND: switch(LOWORD(wParam)) { case IDC_BUTTON1: EndDialog(dhwnd, IDC_BUTTON1);//test button break; case IDCANCEL: EndDialog(dhwnd, IDCANCEL); break; } break; default: return FALSE; } return FALSE; }//end of dialog routine //dialogue ini, from main window proc case WM_LBUTTONDOWN: { int ret = DialogBox(GetModuleHandle(NULL), MAKEINTRESOURC(IDD_DIALOG1),dhwnd, DlgProc); } return 0;
Thanks, hope some one can help.



LinkBack URL
About LinkBacks


