What can be an alternative to AFX_MANAGE_STATE macro?
-
Currently I have constucted a DLL in VC++ 6.0 in which does not uses MFC. I have chosen Win32 Dynamic Link Library template from new project dialog box. Now, only one function is exported from the DLL. In that function I am bringing up an Dialog Box using DialogBoxParam() function. Dialog resource is stored in the DLL itself.
DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DOCONVERTDIALOGBOX), NULL, DoConvert_DlgProc, (LPARAM)(&pDlg));
I have also added a dialog box with ID 'DOCONVERTDIALOGBOX' in the resource of this DLL project. * DialogBoxParam() returns -1. * GetLastError() returns 1814 (ERROR_RESOURCE_NAME_NOT_FOUND) I think if I add AFX_MANAGE_STATE(AfxGetStaticModuleState()); then it will take the resource from DLL. But AFX_MANAGE_STATE is MFC related. And I am not using any MFC related function nor my DLL project is using MFC. So how can I load the dialog resource from DLL. Thanks in advance. -
Currently I have constucted a DLL in VC++ 6.0 in which does not uses MFC. I have chosen Win32 Dynamic Link Library template from new project dialog box. Now, only one function is exported from the DLL. In that function I am bringing up an Dialog Box using DialogBoxParam() function. Dialog resource is stored in the DLL itself.
DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DOCONVERTDIALOGBOX), NULL, DoConvert_DlgProc, (LPARAM)(&pDlg));
I have also added a dialog box with ID 'DOCONVERTDIALOGBOX' in the resource of this DLL project. * DialogBoxParam() returns -1. * GetLastError() returns 1814 (ERROR_RESOURCE_NAME_NOT_FOUND) I think if I add AFX_MANAGE_STATE(AfxGetStaticModuleState()); then it will take the resource from DLL. But AFX_MANAGE_STATE is MFC related. And I am not using any MFC related function nor my DLL project is using MFC. So how can I load the dialog resource from DLL. Thanks in advance.ccpptrain wrote:
DialogBoxParam(hInstance,
How are you getting the instance handle? It should be the one you get in DllMain as an argument.
Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com
-
Currently I have constucted a DLL in VC++ 6.0 in which does not uses MFC. I have chosen Win32 Dynamic Link Library template from new project dialog box. Now, only one function is exported from the DLL. In that function I am bringing up an Dialog Box using DialogBoxParam() function. Dialog resource is stored in the DLL itself.
DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DOCONVERTDIALOGBOX), NULL, DoConvert_DlgProc, (LPARAM)(&pDlg));
I have also added a dialog box with ID 'DOCONVERTDIALOGBOX' in the resource of this DLL project. * DialogBoxParam() returns -1. * GetLastError() returns 1814 (ERROR_RESOURCE_NAME_NOT_FOUND) I think if I add AFX_MANAGE_STATE(AfxGetStaticModuleState()); then it will take the resource from DLL. But AFX_MANAGE_STATE is MFC related. And I am not using any MFC related function nor my DLL project is using MFC. So how can I load the dialog resource from DLL. Thanks in advance. -
ccpptrain wrote:
DialogBoxParam(hInstance,
How are you getting the instance handle? It should be the one you get in DllMain as an argument.
Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com
Well I will try it...
-
ccpptrain wrote:
DialogBoxParam(hInstance,
How are you getting the instance handle? It should be the one you get in DllMain as an argument.
Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com
I am passing NULL for instance. Well, I will try your suggestion
-
ccpptrain wrote:
DialogBoxParam(hInstance,
How are you getting the instance handle? It should be the one you get in DllMain as an argument.
Nibu thomas A Developer Code must be written to be read, not by the compiler, but by another human being. http:\\nibuthomas.wordpress.com
Thanks Nibu it is working.