c++ - Creating and Loading DialogBox from DLL -
i've created dialog box within win32 dll (using resource editor) , want show application programme (using dll) calls displaydialog, not working.
// appprogram.cpp ... lresult callback wndproc(hwnd hwnd, uint msg, wparam wparam, lparam lparam) { switch (msg) { case wm_command: switch (loword (wparam)) { case idm_file_new_dialog: displaydialog (hinst, hwnd); break; ... } break; .... } homecoming defwindowproc(hwnd, msg, wparam, lparam); }
my dll appears like
#include "stdafx.h" #include "mydll.h" export bool callback displaydialog (hinstance hinst, hwnd hwnd) { dialogbox (hinst, makeintresource (idd_dialog1), hwnd, reinterpret_cast<dlgproc> (diagproc)); // messagebox works here } ...
i've tested dll displays dialog if dialog belongs appprogram. here, want display dialog when part of dll.
please suggest whether should create dialog within dll or should pass program. + how show dialog in given scenario. in advance.
something this:
hmodule module = loadlibrary("mydll.dll"); hrsrc res = findresource(module, "#1234", rt_dialog); dlgtemplate* ptemplate = (dlgtemplate*)loadresource(module, res); dialogboxindirect(0, ptemplate, hwnd, dlgproc);
c++ winapi dll
No comments:
Post a Comment