Posted October 17, 201212 yr I'm wanting to create a settings dialog inside of my OllyDbg 2.xx plugin, but I'm stuck at the very first part; creating the dialog...This is the code I'm using right now (and have successfully used in many other win32 projects before)hSettings = CreateDialog(hollyinst, MAKEINTRESOURCE(IDD_SETTINGS), hwollymain, (DLGPROC)SettingsDialogProc);if(hSettings != NULL){ ShowWindow(hSettings, SW_SHOW);}else{ MessageBox(hwollymain, L"CreateDialog returned NULL", L"OllyID", MB_OK | MB_ICONINFORMATION);}With this hSettings always returns NULL. What am I missing?
October 17, 201212 yr HiI cannot c++ but have you try remove (DLGPROC)example:hSettings = CreateDialog(hollyinst, MAKEINTRESOURCE(IDD_SETTINGS), hwollymain, SettingsDialogProc);or with &SettingsDialogProcgreets
October 18, 201212 yr From MSDN: HWND WINAPI CreateDialog(_In_opt_ HINSTANCE hInstance, _In_ LPCTSTR lpTemplate, _In_opt_ HWND hWndParent, _In_opt_ DLGPROC lpDialogFunc ); Parameters hInstance [in, optional] A handle to the module whose executable file contains the dialog box template. You have resources in your DLL, not in Ollydbg.exe, right? Replace hollyinst with hinstYourPluginDLL and it will work just fine.
October 19, 201212 yr Author Got it working. Used a modal dialog (Thanks RaMMicHaeL).HINSTANCE hSettingsInstance = (HINSTANCE)GetModuleHandle(L"OllyID.dll");DialogBox(hSettingsInstance, MAKEINTRESOURCE(IDD_SETTINGS), hwollymain, (DLGPROC)SettingsDialogProc);
Create an account or sign in to comment