DialogBox of win32 dll
-
dear all, I have dll in which one the function should display a dialog box( this dialogbox resource is in dll)when it called by the aplication ,which has loaded this library (using Loadlibrary()). But problem here is ,when the application calls this function( which is exported by dll) the dialogbox is not displaying properly and the program stops continuing execution. To solve this i used AFX_MANAGE_STATE(),but when i compile it displayed AFX_MANAGE_STATE is undefined variable( i complied using nmake in SDK platform environment)..
Manjunath S GESL Bangalore
-
dear all, I have dll in which one the function should display a dialog box( this dialogbox resource is in dll)when it called by the aplication ,which has loaded this library (using Loadlibrary()). But problem here is ,when the application calls this function( which is exported by dll) the dialogbox is not displaying properly and the program stops continuing execution. To solve this i used AFX_MANAGE_STATE(),but when i compile it displayed AFX_MANAGE_STATE is undefined variable( i complied using nmake in SDK platform environment)..
Manjunath S GESL Bangalore
Manjunath S wrote:
But problem here is ,when the application calls this function( which is exported by dll) the dialogbox is not displaying properly and the program stops continuing execution.
What do you mean by this? can you be more specific. Why dont you tried using MFC dll's.
Prasad Notifier using ATL
-
Manjunath S wrote:
But problem here is ,when the application calls this function( which is exported by dll) the dialogbox is not displaying properly and the program stops continuing execution.
What do you mean by this? can you be more specific. Why dont you tried using MFC dll's.
Prasad Notifier using ATL
Actually i have created a dialogbox in an exsisting Dll sample code and tried to display the dialogbox which i have created But it is giving an error(Err No.1813,Specified Resource type cannot be found in the Image file) Thanks
Manjunath S GESL Bangalore
-
Actually i have created a dialogbox in an exsisting Dll sample code and tried to display the dialogbox which i have created But it is giving an error(Err No.1813,Specified Resource type cannot be found in the Image file) Thanks
Manjunath S GESL Bangalore
can you show code, you have used? My suggestion would be use MFC dlls otherwise.
Prasad Notifier using ATL
-
can you show code, you have used? My suggestion would be use MFC dlls otherwise.
Prasad Notifier using ATL
Hi code is as follows if((hInst_temp = GetModuleHandle(NULL))==NULL) { MessageBox(NULL,"GetModuleHandle error",NULL,MB_OK); } if(-1 ==WlxDialogBoxParam(hWlx, hInst_temp,MAKEINTRESOURCE(IDD_DXCAPTURE_DIALOG),NULL, MyCaptureDlgProc, dwInitParam)) { LPVOID lpMsgBuf; LPVOID lpDisplayBuf; DWORD dw = GetLastError(); FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT, lstrlen((LPCTSTR)lpMsgBuf)+lstrlen((LPCTSTR)"gina")) *sizeof(TCHAR)); wsprintf((LPTSTR)lpDisplayBuf, TEXT("%s failed with error %d: %s"), "Gina", dw, lpMsgBuf); MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK); LocalFree(lpMsgBuf); LocalFree(lpDisplayBuf); } error number is 1813( ths specified resource type cannot found in image file)
Manjunath S GESL Bangalore
-
Hi code is as follows if((hInst_temp = GetModuleHandle(NULL))==NULL) { MessageBox(NULL,"GetModuleHandle error",NULL,MB_OK); } if(-1 ==WlxDialogBoxParam(hWlx, hInst_temp,MAKEINTRESOURCE(IDD_DXCAPTURE_DIALOG),NULL, MyCaptureDlgProc, dwInitParam)) { LPVOID lpMsgBuf; LPVOID lpDisplayBuf; DWORD dw = GetLastError(); FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT, lstrlen((LPCTSTR)lpMsgBuf)+lstrlen((LPCTSTR)"gina")) *sizeof(TCHAR)); wsprintf((LPTSTR)lpDisplayBuf, TEXT("%s failed with error %d: %s"), "Gina", dw, lpMsgBuf); MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT("Error"), MB_OK); LocalFree(lpMsgBuf); LocalFree(lpDisplayBuf); } error number is 1813( ths specified resource type cannot found in image file)
Manjunath S GESL Bangalore
Just an advise, use
pre
tags for code, its become readable.Manjunath S wrote:
if(-1 ==WlxDialogBoxParam(hWlx, hInst_temp,MAKEINTRESOURCE(IDD_DXCAPTURE_DIALOG),NULL, MyCaptureDlgProc, dwInitParam))
Is it dll code ? I'm not sure, but its something related to AfxSetResourcehandle, you need to set it right for calling process.
Prasad Notifier using ATL
-
Just an advise, use
pre
tags for code, its become readable.Manjunath S wrote:
if(-1 ==WlxDialogBoxParam(hWlx, hInst_temp,MAKEINTRESOURCE(IDD_DXCAPTURE_DIALOG),NULL, MyCaptureDlgProc, dwInitParam))
Is it dll code ? I'm not sure, but its something related to AfxSetResourcehandle, you need to set it right for calling process.
Prasad Notifier using ATL
Hi, Thanks for your useful response ... Now its working fine... I also made a mistake in dialog procedure
Manjunath S GESL Bangalore
-
Hi, Thanks for your useful response ... Now its working fine... I also made a mistake in dialog procedure
Manjunath S GESL Bangalore
Cheers !
Prasad Notifier using ATL