schumi1980
June 4th, 2004, 07:01 PM
Hi everyone !!!
This is the problem i am facing. I am exporting a function from a dll that pops up a dialogbox ( which i created at design time using Insert>Resource>Dialog..)
Now when i call the dll inside another application, the dialogbox doesnt pop up. please lemme how this is to be done. This is the code so i have been working with. Thanks in advance
include "windows.h"
#include "resource.h"
LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(wParam)
{
case IDA:
// TO DO
EndDialog(hWndDlg, 0);
return TRUE;
case IDB:
// TO DO
EndDialog(hWndDlg, 0);
return TRUE;
}
case WM_CLOSE:
EndDialog(hWndDlg, 0);
return TRUE;
break;
}
return FALSE;
}
void __declspec(dllexport) brow()
{
DialogBox((HINSTANCE)GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DLGFIRST), NULL, (DLGPROC)DlgProc);
}
BOOL APIENTRY DllMain( HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved )
{
return TRUE;
}
This is the problem i am facing. I am exporting a function from a dll that pops up a dialogbox ( which i created at design time using Insert>Resource>Dialog..)
Now when i call the dll inside another application, the dialogbox doesnt pop up. please lemme how this is to be done. This is the code so i have been working with. Thanks in advance
include "windows.h"
#include "resource.h"
LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
switch(Msg)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch(wParam)
{
case IDA:
// TO DO
EndDialog(hWndDlg, 0);
return TRUE;
case IDB:
// TO DO
EndDialog(hWndDlg, 0);
return TRUE;
}
case WM_CLOSE:
EndDialog(hWndDlg, 0);
return TRUE;
break;
}
return FALSE;
}
void __declspec(dllexport) brow()
{
DialogBox((HINSTANCE)GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_DLGFIRST), NULL, (DLGPROC)DlgProc);
}
BOOL APIENTRY DllMain( HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved )
{
return TRUE;
}