- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I used CVF to built an MDI project and I associated to it a Dll as subproject. Inside the DllI define a simple dialog ( resources , call back routines ) and a subroutine DisplayDialog wich create the dialog with the CreateDialogParam and show it with ShowWindow.
When I call the subroutine DisplayDialog from the MDI project , the dialog isn't displayed. But when I insert the same dialog like a new resource in the MDI ( I use the same name used in the Dll) and I call the subroutine DisplayDialog it works.
How to do to force the MDI to use resources defined in the Dll?
Thanks for your help in advance
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hmodule=GetModuleHandle ('MYRESOURCE.DLL')
iret=DLGINITWITHRESOURCEHANDLE (ID_DIALOG, hmodule, dlg)
Look it up in the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hmodule=GetModuleHandle ('MYRESOURCE.DLL')
iret=DLGINITWITHRESOURCEHANDLE (ID_DIALOG, hmodule, dlg)
Look it up in the help.
MODULE MDI_DIALOG
use Common_DerivedTypes
use DFWIN
integer, private:: iret
integer, private:: dllDialog_handle
Contains
!______________________________________________________________!
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
subroutine ComponentMenu(ghInstance,hwnd)
!DEC$ ATTRIBUTES STDCALL,ALIAS :"ComponentMenu":: ComponentMenu
!DEC$ ATTRIBUTES DLLEXPORT::ComponentMenu
use dflogm
implicit none
include "resource.fd"
integer ghInstance
integer hwnd
integer dialogH
integer id
dialogH=CreateDialogParam(ghInstance,IDD_DIALOG_dll,hwnd,loc(DialgCallBack),0)
iret=ShowWindow(dialogH,SW_SHOW)
return
end subroutine ComponentMenu
integer*4 function DialgCallBack( hDlg,message,uParam,lParam )
!_-_-_-_-_-_-_-_- Compiler options _-_-_-_-_-_-_-_-!
!DEC$ ATTRIBUTES STDCALL,ALIAS :"DialgCallBack":: DialgCallBack
!_-_-_-_-_-_-_-_- USED MODULE _-_-_-_-_-_-_-_-!
use comctl32
use DFWIN
use user32
use kernel32
Implicit None
include 'RESOURCE.fd'
!_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- USED VARIABLES _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-!
integer hDlg
integer message
integer uparam
integer lparam
logical free_status
select case(message)
case( WM_INITDIALOG)
DialgCallBack=1
return
case (WM_COMMAND)
select case (LOWORD(uParam))
case(IDOK)
iret=1
end select
DialgCallBack=1
return
case(WM_close)
iret= destroyWindow(hDlg)
return
end select
DialgCallBack=0
return
end function DialgCallBack
END MODULE MDI_DIALOG
the part of the main program :
!****************************************************************************
!
! FUNCTION: MainWndProc ( hWnd, mesg, wParam, lParam )
!
! PURPOSE: Processes messages for the main window
!
! COMMENTS:
!
!****************************************************************************
integer function MainWndProc ( hWnd, mesg, wParam, lParam )
!DEC$ IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_MainWndProc@16' :: MainWndProc
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'MainWndProc' :: MainWndProc
!DEC$ ENDIF
use user32
use kernel32
use dfwbase
use ThessGlobals
use dflogm
implicit none
integer*4 hWnd
integer*4 mesg
integer*4 wParam
integer*4 lParam
include 'resource.fd'
! Variables
type (T_CLIENTCREATESTRUCT) clientcreate
type (T_MDICREATESTRUCT) mdicreate
type (Dialog) dlg
type (PERWNDINFO) Info
pointer (P_ComponentMenu,ComponentMenu)
integer hwndChildWindow
integer hInfo
integer pInfo
integer IDD_DIALOG_dll
integer hActiveChild
integer dllDialog_handle
integer ret
character(SIZEOFAPPNAME) lpszTitle, lpszCaption
character(SIZEOFAPPNAME) lpszName, lpszHelpFileName, lpszContents, lpszMessage
character(SIZEOFAPPNAME) lpszHeader
logical Lret
logical free_status
!=================================================================!
interface
integer*4 function AboutDlgProc( hwnd, mesg, wParam, lParam )
!DEC$ IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_AboutDlgProc@16' :: AboutDlgProc
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'AboutDlgProc' :: AboutDlgProc
!DEC$ ENDIF
integer*4 hwnd
integer*4 mesg
integer*4 wParam
integer*4 lParam
end function
end interface
interface
subroutine ComponentMenu(ghInstance,hwnd)
!DEC$ ATTRIBUTES STDCALL,ALIAS :"ComponentMenu":: ComponentMenu
!DEC$ ATTRIBUTES DLLIMPORT::ComponentMenu
implicit none
integer ghInstance
integer hwnd
end subroutine ComponentMenu
end interface
select case ( mesg )
! WM_CREATE: Create the MDICLIENT window which contains the MDI children
case (WM_CREATE)
lpszName = "MDICLIENT"C
clientcreate%hWindowMenu = ghMenuWindow
clientcreate%idFirstChild = 1
ghwndClient = CreateWindow( &
lpszName, ""C, &
IOR(WS_CHILD, IOR(WS_CLIPCHILDREN, WS_VISIBLE)),&
0, 0, 0, 0, &
hwnd, NULL, ghInstance, &
LOC(clientcreate))
MainWndProc = 0
return
! WM_DESTROY: PostQuitMessage() is called
case (WM_DESTROY)
call PostQuitMessage( 0 )
MainWndProc = 0
return
! WM_COMMAND: user command
case (WM_COMMAND)
select case ( IAND(wParam, 16#ffff ) )
case(IDM_RunDialog)
dllDialog_handle = LoadLibrary ("BurnersClass.dll"C)
if (dllDialog_handle == NULL) then
! Failure
stop
end if
P_ComponentMenu =GetProcAddress (dllDialog_handle, "ComponentMenu"C)
if (P_ComponentMenu == NULL) then
! Failure
stop
end if
ret = DlgInitwithresourcehandle(IDD_DIALOG_dll, dllDialog_handle, dlg)
call ComponentMenu(ghInstance,hwnd)
! Handle standard MDI messages
case (IDM_TILE)
ret = SendMessage( &
ghwndClient, WM_MDITILE, 0, 0)
MainWndProc = 0
return
case (IDM_CASCADE)
ret = SendMessage( &
ghwndClient, WM_MDICASCADE, 0, 0)
MainWndProc = 0
return
case (IDM_ARRANGE)
ret = SendMessage( &
ghwndClient, WM_MDIICONARRANGE, 0, 0)
MainWndProc = 0
return
case (IDM_NEW)
! Creates MDI child
! Allocate memory for INFO to be associated with the
! new child
hInfo = LocalAlloc(LHND, SIZEOFINFO)
if (hInfo .NE. 0) then
pInfo = LocalLock(hInfo)
if (pInfo == NULL) then
ret = MessageBox(ghwndMain,"Failed in LocalLock"C,"Error"C, MB_OK)
end if
ret = lstrcpy(lpszCaption, "MDI "C)
write (lpszCaption, 100 ) giMDICount
100 format ('MDI', I4)
Info%CaptionBarText = lpszCaption
Info%hParent = ghwndClient
call CopyMemory(pInfo, LOC(Info), 44) ! SIZEOFINFO = 44
lpszTitle = Info%CaptionBarText // ""C
lpszName ="Thess"C
mdicreate%szClass = LOC(lpszName)
mdicreate%szTitle = LOC(lpszTitle)
mdicreate%hOwner = ghModule
mdicreate%x = CW_USEDEFAULT
mdicreate%y = CW_USEDEFAULT
mdicreate%cx = CW_USEDEFAULT
mdicreate%cy = CW_USEDEFAULT
mdicreate%style = 0
! Pass the handle of the per MDI child INFO to the
! child MDI window for storage
mdicreate%lParam = hInfo
! Create Child Window
hwndChildWindow = SendMessage(ghwndClient, &
WM_MDICREATE, INT4(0), &
LOC(mdicreate))
if (hwndChildWindow == NULL) then
ret = MessageBox(ghwndMain,"Failed in Creating Child Window"C,&
"Error"C, MB_OK)
MainWndProc = 0
return
end if
giMDICount = giMDICount + 1
lret = LocalUnlock(hInfo)
else
ret = MessageBox(ghwndMain,"Failed to Allocate INFO data!"C,&
"Error"C, MB_OK)
end if
MainWndProc = 0
return
! Pass these WM_COMMAND messages to the appropriate active child
! window proc for processing
case (IDM_OPT_1, IDM_OPT_2, IDM_OPT_3, IDM_OPT_4, &
IDM_OPT_5, IDM_OPT_6, IDM_OPT_7, IDM_OPT_8)
hActiveChild = SendMessage(ghwndClient, &
WM_MDIGETACTIVE, 0, 0)
if (hActiveChild .NE. 0) then
ret = SendMessage(hActiveChild, WM_COMMAND, &
wParam, lParam)
end if
MainWndProc = 0
return
case (IDM_EXIT)
ret = SendMessage( hWnd, WM_CLOSE, 0, 0 )
MainWndProc = 0
return
case (IDM_ABOUT)
lpszName = "AboutDlg"C
ret = DialogBoxParam(ghInstance,LOC(lpszName),hWnd,&
LOC(AboutDlgProc), 0)
MainWndProc = 0
return
case (IDM_HELPCONTENTS)
lpszHelpFileName ="\Thess.hlp"C
lpszContents = "CONTENTS"C
if (WinHelp (hWnd, lpszHelpFileName, HELP_KEY, &
LOC(lpszContents)) .EQV. .FALSE.) then
lpszMessage = "Unable to activate help"C
lpszHeader = "Thess"
ret = MessageBox (hWnd, &
lpszMessage, &
lpszHeader, &
IOR(MB_SYSTEMMODAL, &
IOR(MB_OK, MB_ICONHAND)))
end if
MainWndProc = 0
return
case (IDM_HELPSEARCH)
lpszHelpFileName ="\Thess.hlp"C
lpszContents = "CONTENTS"C
if (WinHelp(hWnd, "Thess.hlp"C, &
HELP_PARTIALKEY, LOC(""C)) .EQV. .FALSE.) then
lpszMessage = "Unable to activate help"C
lpszHeader = "Thess"C
ret = MessageBox (hWnd, &
lpszMessage, &
lpszHeader, &
IOR(MB_SYSTEMMODAL , &
IOR(MB_OK, MB_ICONHAND)))
end if
MainWndProc = 0
return
case (IDM_HELPHELP)
if (WinHelp(hWnd, ""C, HELP_HELPONHELP, 0).EQV. .FALSE.)&
then
lpszMessage = "Unable to activate help"C
lpszHeader = "Thess"C
ret = MessageBox (GetFocus(), &
lpszMessage, &
lpszHeader, &
IOR(MB_SYSTEMMODAL,IOR(MB_OK, MB_ICONHAND)))
end if
MainWndProc = 0
return
! All of the other possible menu options are currently disabled
case DEFAULT
MainWndProc = DefFrameProc( hWnd, ghwndClient, mesg, wParam, lParam )
return
end select
! Let the default window proc handle all other messages
case default
MainWndProc = DefFrameProc( hWnd, ghwndClient, mesg, wParam, lParam )
end select
end
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you for the council. I rewtrite my reply :
I insert the instruction :iret=DLGINITWITHRESOURCEHANDLE (ID_DIALOG, hmodule, dlg) in the main propgram but the problem persists.The dll code called BurnersClass is :
[cpp]MODULE MDI_DIALOG use Common_DerivedTypes use DFWIN integer, private:: iret integer, private:: dllDialog_handle Contains !______________________________________________________________! !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++! subroutine ComponentMenu(ghInstance,hwnd) !DEC$ ATTRIBUTES STDCALL,ALIAS :"ComponentMenu":: ComponentMenu !DEC$ ATTRIBUTES DLLEXPORT::ComponentMenu use dflogm implicit none include "resource.fd" integer ghInstance integer hwnd integer dialogH integer id dialogH=CreateDialogParam(ghInstance,IDD_DIALOG_dll,hwnd,loc(DialgCallBack),0) iret=ShowWindow(dialogH,SW_SHOW) return end subroutine ComponentMenu integer*4 function DialgCallBack( hDlg,message,uParam,lParam ) !_-_-_-_-_-_-_-_- Compiler options _-_-_-_-_-_-_-_-! !DEC$ ATTRIBUTES STDCALL,ALIAS :"DialgCallBack":: DialgCallBack !_-_-_-_-_-_-_-_- USED MODULE _-_-_-_-_-_-_-_-! use comctl32 use DFWIN use user32 use kernel32 Implicit None include 'RESOURCE.fd' !_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- USED VARIABLES _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-! integer hDlg integer message integer uparam integer lparam logical free_status select case(message) case( WM_INITDIALOG) DialgCallBack=1 return case (WM_COMMAND) select case (LOWORD(uParam)) case(IDOK) iret=1 end select DialgCallBack=1 return case(WM_close) iret= destroyWindow(hDlg) return end select DialgCallBack=0 return end function DialgCallBack END MODULE MDI_DIALOG the part of the main program : !**************************************************************************** ! ! FUNCTION: MainWndProc ( hWnd, mesg, wParam, lParam ) ! ! PURPOSE: Processes messages for the main window ! ! COMMENTS: ! !**************************************************************************** integer function MainWndProc ( hWnd, mesg, wParam, lParam ) !DEC$ IF DEFINED(_X86_) !DEC$ ATTRIBUTES STDCALL, ALIAS : '_MainWndProc@16' :: MainWndProc !DEC$ ELSE !DEC$ ATTRIBUTES STDCALL, ALIAS : 'MainWndProc' :: MainWndProc !DEC$ ENDIF use user32 use kernel32 use dfwbase use ThessGlobals use dflogm implicit none integer*4 hWnd integer*4 mesg integer*4 wParam integer*4 lParam include 'resource.fd' ! Variables type (T_CLIENTCREATESTRUCT) clientcreate type (T_MDICREATESTRUCT) mdicreate type (Dialog) dlg type (PERWNDINFO) Info pointer (P_ComponentMenu,ComponentMenu) integer hwndChildWindow integer hInfo integer pInfo integer IDD_DIALOG_dll integer hActiveChild integer dllDialog_handle integer ret character(SIZEOFAPPNAME) lpszTitle, lpszCaption character(SIZEOFAPPNAME) lpszName, lpszHelpFileName, lpszContents, lpszMessage character(SIZEOFAPPNAME) lpszHeader logical Lret logical free_status !=================================================================! interface integer*4 function AboutDlgProc( hwnd, mesg, wParam, lParam ) !DEC$ IF DEFINED(_X86_) !DEC$ ATTRIBUTES STDCALL, ALIAS : '_AboutDlgProc@16' :: AboutDlgProc !DEC$ ELSE !DEC$ ATTRIBUTES STDCALL, ALIAS : 'AboutDlgProc' :: AboutDlgProc !DEC$ ENDIF integer*4 hwnd integer*4 mesg integer*4 wParam integer*4 lParam end function end interface interface subroutine ComponentMenu(ghInstance,hwnd) !DEC$ ATTRIBUTES STDCALL,ALIAS :"ComponentMenu":: ComponentMenu !DEC$ ATTRIBUTES DLLIMPORT::ComponentMenu implicit none integer ghInstance integer hwnd end subroutine ComponentMenu end interface select case ( mesg ) ! WM_CREATE: Create the MDICLIENT window which contains the MDI children case (WM_CREATE) lpszName = "MDICLIENT"C clientcreate%hWindowMenu = ghMenuWindow clientcreate%idFirstChild = 1 ghwndClient = CreateWindow( & lpszName, ""C, & IOR(WS_CHILD, IOR(WS_CLIPCHILDREN, WS_VISIBLE)),& 0, 0, 0, 0, & hwnd, NULL, ghInstance, & LOC(clientcreate)) MainWndProc = 0 return ! WM_DESTROY: PostQuitMessage() is called case (WM_DESTROY) call PostQuitMessage( 0 ) MainWndProc = 0 return ! WM_COMMAND: user command case (WM_COMMAND) select case ( IAND(wParam, 16#ffff ) ) case(IDM_RunDialog) dllDialog_handle = LoadLibrary ("BurnersClass.dll"C) if (dllDialog_handle == NULL) then ! Failure stop end if P_ComponentMenu =GetProcAddress (dllDialog_handle, "ComponentMenu"C) if (P_ComponentMenu == NULL) then ! Failure stop end if ret = DlgInitwithresourcehandle(IDD_DIALOG_dll, dllDialog_handle, dlg) call ComponentMenu(ghInstance,hwnd) ! Handle standard MDI messages case (IDM_TILE) ret = SendMessage( & ghwndClient, WM_MDITILE, 0, 0) MainWndProc = 0 return case (IDM_CASCADE) ret = SendMessage( & ghwndClient, WM_MDICASCADE, 0, 0) MainWndProc = 0 return case (IDM_ARRANGE) ret = SendMessage( & ghwndClient, WM_MDIICONARRANGE, 0, 0) MainWndProc = 0 return case (IDM_NEW) ! Creates MDI child ! Allocate memory for INFO to be associated with the ! new child hInfo = LocalAlloc(LHND, SIZEOFINFO) if (hInfo .NE. 0) then pInfo = LocalLock(hInfo) if (pInfo == NULL) then ret = MessageBox(ghwndMain,"Failed in LocalLock"C,"Error"C, MB_OK) end if ret = lstrcpy(lpszCaption, "MDI "C) write (lpszCaption, 100 ) giMDICount 100 format ('MDI', I4) Info%CaptionBarText = lpszCaption Info%hParent = ghwndClient call CopyMemory(pInfo, LOC(Info), 44) ! SIZEOFINFO = 44 lpszTitle = Info%CaptionBarText // ""C lpszName ="Thess"C mdicreate%szClass = LOC(lpszName) mdicreate%szTitle = LOC(lpszTitle) mdicreate%hOwner = ghModule mdicreate%x = CW_USEDEFAULT mdicreate%y = CW_USEDEFAULT mdicreate%cx = CW_USEDEFAULT mdicreate%cy = CW_USEDEFAULT mdicreate%style = 0 ! Pass the handle of the per MDI child INFO to the ! child MDI window for storage mdicreate%lParam = hInfo ! Create Child Window hwndChildWindow = SendMessage(ghwndClient, & WM_MDICREATE, INT4(0), & LOC(mdicreate)) if (hwndChildWindow == NULL) then ret = MessageBox(ghwndMain,"Failed in Creating Child Window"C,& "Error"C, MB_OK) MainWndProc = 0 return end if giMDICount = giMDICount + 1 lret = LocalUnlock(hInfo) else ret = MessageBox(ghwndMain,"Failed to Allocate INFO data!"C,& "Error"C, MB_OK) end if MainWndProc = 0 return ! Pass these WM_COMMAND messages to the appropriate active child ! window proc for processing case (IDM_OPT_1, IDM_OPT_2, IDM_OPT_3, IDM_OPT_4, & IDM_OPT_5, IDM_OPT_6, IDM_OPT_7, IDM_OPT_8) hActiveChild = SendMessage(ghwndClient, & WM_MDIGETACTIVE, 0, 0) if (hActiveChild .NE. 0) then ret = SendMessage(hActiveChild, WM_COMMAND, & wParam, lParam) end if MainWndProc = 0 return case (IDM_EXIT) ret = SendMessage( hWnd, WM_CLOSE, 0, 0 ) MainWndProc = 0 return case (IDM_ABOUT) lpszName = "AboutDlg"C ret = DialogBoxParam(ghInstance,LOC(lpszName),hWnd,& LOC(AboutDlgProc), 0) MainWndProc = 0 return case (IDM_HELPCONTENTS) lpszHelpFileName ="Thess.hlp"C lpszContents = "CONTENTS"C if (WinHelp (hWnd, lpszHelpFileName, HELP_KEY, & LOC(lpszContents)) .EQV. .FALSE.) then lpszMessage = "Unable to activate help"C lpszHeader = "Thess" ret = MessageBox (hWnd, & lpszMessage, & lpszHeader, & IOR(MB_SYSTEMMODAL, & IOR(MB_OK, MB_ICONHAND))) end if MainWndProc = 0 return case (IDM_HELPSEARCH) lpszHelpFileName ="Thess.hlp"C lpszContents = "CONTENTS"C if (WinHelp(hWnd, "Thess.hlp"C, & HELP_PARTIALKEY, LOC(""C)) .EQV. .FALSE.) then lpszMessage = "Unable to activate help"C lpszHeader = "Thess"C ret = MessageBox (hWnd, & lpszMessage, & lpszHeader, & IOR(MB_SYSTEMMODAL , & IOR(MB_OK, MB_ICONHAND))) end if MainWndProc = 0 return case (IDM_HELPHELP) if (WinHelp(hWnd, ""C, HELP_HELPONHELP, 0).EQV. .FALSE.)& then lpszMessage = "Unable to activate help"C lpszHeader = "Thess"C ret = MessageBox (GetFocus(), & lpszMessage, & lpszHeader, & IOR(MB_SYSTEMMODAL,IOR(MB_OK, MB_ICONHAND))) end if MainWndProc = 0 return ! All of the other possible menu options are currently disabled case DEFAULT MainWndProc = DefFrameProc( hWnd, ghwndClient, mesg, wParam, lParam ) return end select ! Let the default window proc handle all other messages case default MainWndProc = DefFrameProc( hWnd, ghwndClient, mesg, wParam, lParam ) end select end [/cpp]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the program fails to perform as expected, along with the return value of a call to a function if that call fails to produce the required result.
Have you made sure that the resource-holding DLL is in the same folder as the executable that requires it, or is at least in a folder in the your search PATH?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the program fails to perform as expected, along with the return value of a call to a function if that call fails to produce the required result.
Have you made sure that the resource-holding DLL is in the same folder as the executable that requires it, or is at least in a folder in the your search PATH?
I join the total project in a zip file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I join the total project in a zip file
If the resource exists in the DLL, and if the DLL is found, then dllDialog_handle will be a valid handle and the resource IDD_DIALOG_dll will be found. Check that the dialog resource exists in the DLL with exactly the name you post. Also Check that you have a valid dllDialog_handle.
edit: I have just realised that you seem to have omitteda command to display the dialog, either using DLGMODAL or DLGMODELESS. Is that correct? Add DLGMODAL(dlg) and you should see your dialog.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I join the total project in a zip file
If the resource exists in the DLL, and if the DLL is found, then dllDialog_handle will be a valid handle and the resource IDD_DIALOG_dll will be found. Check that the dialog resource exists in the DLL with exactly the name you post. Also Check that you have a valid dllDialog_handle.
edit: I have just realised that you seem to have omitteda command to display the dialog, either using DLGMODAL or DLGMODELESS. Is that correct? Add DLGMODAL(dlg) and you should see your dialog.
When i debug the main program the return value of the instruction ret = DlgInitwithresourcehandle(IDD_DIALOG_dll, dllDialog_handle, dlg) is null in spite that the dllDialog_handle is valid (different from zero). Consequently and without dubt the error is due to the fact that the main program have'nt detected the DLL Resources.
You can see in the zip attached file, that:
1- Dll's resources are well defined.
2- In the Dll, I use the function ShowWindow to display the Dialog
With regard to DLGMODAL or DLGMODELESS, I think that oneuses them in a quickwin project not a MDI project. In the last case they generate unkown error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With regard to DLGMODAL or DLGMODELESS, I think that oneuses them in a quickwin project not a MDI project. In the last case they generate unkown error.
You can use DlgModal or DlgModeless in any type of project, including even Console project (well, DlgModeless has some issues, but in principle it could work). If you use DlgModal or DlgModeless, you must use DlgInitWithResourceHandle.
What you cannot do, and you're actually doing, is to use DlgInitWithResourceHandle but to display it with DialogBox or CreateDialog[Param]. If you use DialogBox or CreateDialog[Param], you must use its hInstance argument to tell it to load from the dll.
P.S. Not really related, but you should avoid LocalAlloc/LocalLock/LocalUnlock. In the case at hand, you need just to locally declare a variable of TYPE(T_INFO) and set mdicreate%lParam to LOC(Info).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use DlgModal or DlgModeless in any type of project, including even Console project (well, DlgModeless has some issues, but in principle it could work). If you use DlgModal or DlgModeless, you must use DlgInitWithResourceHandle.
What you cannot do, and you're actually doing, is to use DlgInitWithResourceHandle but to display it with DialogBox or CreateDialog[Param]. If you use DialogBox or CreateDialog[Param], you must use its hInstance argument to tell it to load from the dll.
P.S. Not really related, but you should avoid LocalAlloc/LocalLock/LocalUnlock. In the case at hand, you need just to locally declare a variable of TYPE(T_INFO) and set mdicreate%lParam to LOC(Info).
Ideed, my error isto us DlgInitWithResourceHandle to display it with CreateDialog[Param]. I took your advice and it works. Thank you very much for your help.
Concerning The P.S , did T_info is a predifinedtype?. If it is the case, in which module can i find it. I soughtin the folder c:programesFilesvisualstudioDF98include repertory without results.
a predifined type type?. If it is the case, in which module can i find it. I I sought in thing in the folder c:programesFilesvisualstudioDF98include repertory without results.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page