hello, here is the working dialog box i want to appear by calling the dll function DialogInvoke
http://www.codeproject.com/Articles/3984/Customizing-the-quot-Browse-for-folder-quot-dialog
it's working fine, but i need to somehow remake it so the dialog will pop up in another programm.
so this is the code in my main function to load the dll
Code:
typedef LRESULT (*DisplayMyMessage_pfn)(HWND) ;
HMODULE hmod = LoadLibraryA("d:\\working BrowseForFolder\\BrowseForFolder\\release\\BrowseForFolder.dll");
if (!hmod)
{
reportError ( "LoadLibrary failed" );
return 1;
}//if
DisplayMyMessage_pfn dm =
(DisplayMyMessage_pfn)GetProcAddress(hmod, "DialogInvoke");
if (!dm)
{
FreeLibrary(hmod);
reportError ( "GerProcAddress failed" );
return 1;
}//if
dm(0);
FreeLibrary(hmod);
also it seems i must create DllMain function
HINSTANCE g_hInst = 0;
seems i must define the DllMain function
Code:
BOOL WINAPI DllMain(HINSTANCE hInst, DWORD Reason, LPVOID Reserved)
{
if (Reason == DLL_PROCESS_ATTACH)
ghInstance = hInst;
return TRUE;
}
here is the DialogInvoke function i want to use as dll function
Code:
extern "C" __declspec (dllexport) int DialogInvoke ( )
{
DialogBox(ghInstance,MAKEINTRESOURCE(IDD_DIALOG1),NULL,MainDlgProc);
return 0;
}
but the dialog simply doesn't appears