<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using DLLs in MDI project in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857491#M67931</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/411710"&gt;moncef&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;BR /&gt;Excuse me i forget to perform step 7.&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;1) You had a copy of DialogDll.dll in the root folder. Don't copy files manually -- it's a recipe for disaster when you forget to do the copying. Instead, go to Project Settings/General/Output files for the dll, and type "../Debug" (or ../Release). In this way, the dll will be automatically created in the MDI_UsingDllsDebug folder. Delete the one from the root folder&lt;BR /&gt;&lt;BR /&gt;2) You don't need reference here:&lt;BR /&gt;!DEC$ ATTRIBUTES STDCALL, &lt;SPAN style="text-decoration: line-through;"&gt;REFERENCE&lt;/SPAN&gt;,ALIAS :"DialgCallBack":: DialgCallBack&lt;BR /&gt;&lt;BR /&gt;3) Don't LoadLibrary on every entry to MainWndProc (it's not actively harmful, but you increase reference count to infinity). You can do it either on WM_CREATE (you need to SAVE dllDialog_handle in that case), or on IDM_RunDialog. It's nice if you also call FreeLibrary when you don't need it.&lt;BR /&gt;</description>
    <pubDate>Wed, 28 Jan 2009 14:44:47 GMT</pubDate>
    <dc:creator>Jugoslav_Dujic</dc:creator>
    <dc:date>2009-01-28T14:44:47Z</dc:date>
    <item>
      <title>Using DLLs in MDI project</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857482#M67922</link>
      <description>&lt;P&gt;Iam using CVF to built an MDI project and I have a problem to call a Dialog Box written in a DLL wich is a subproject of the main project.&lt;/P&gt;
&lt;P&gt;The source code of the DLL called BurnersClass.dll is :&lt;/P&gt;
&lt;P&gt;integer*4 function ComponentBurner(BurnerTyp,GlobalIcon)&lt;/P&gt;
&lt;P&gt;!DEC$ ATTRIBUTES STDCALL, REFERENCE,ALIAS :"ComponentBurner":: ComponentBurner&lt;/P&gt;
&lt;P&gt;!DEC$ ATTRIBUTES DLLEXPORT::ComponentBurner&lt;/P&gt;
&lt;P&gt;include 'resource.fd'&lt;/P&gt;
&lt;P&gt;integer BurnerTyp&lt;/P&gt;
&lt;P&gt;integer GlobalIcon&lt;/P&gt;
&lt;P&gt;BurnerMenu%handle=CreateDialogParam(HandleAndInstance%ghInstance,IDD_Component_Tab, &amp;amp;&lt;/P&gt;
&lt;P&gt;  MDI_WINDOW_Current%Handle, loc(BurnerTab),0)     &lt;/P&gt;
&lt;P&gt;.......&lt;/P&gt;
&lt;P&gt;ComponentBurner=0&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;end function ComponentBurner&lt;/P&gt;
&lt;P&gt;!======================================================!&lt;/P&gt;
&lt;P&gt;integer*4 function BurnerTab( hDlg,message,uParam,lParam )&lt;/P&gt;
&lt;P&gt;!DEC$ ATTRIBUTES STDCALL, REFERENCE,ALIAS :"BurnerTab":: BurnerTab&lt;/P&gt;
&lt;P&gt;!DEC$ ATTRIBUTES DLLEXPORT::BurnerTab&lt;/P&gt;
&lt;P&gt;use user32&lt;/P&gt;
&lt;P&gt;use kernel32&lt;/P&gt;
&lt;P&gt;implicit none&lt;/P&gt;
&lt;P&gt;include "Resource.fd"&lt;/P&gt;
&lt;P&gt;integer hDlg&lt;/P&gt;
&lt;P&gt;integer message&lt;/P&gt;
&lt;P&gt;integer uparam,lparam &lt;/P&gt;
&lt;P&gt;type (T_NMHDR) itabmessage&lt;/P&gt;
&lt;P&gt;select case(message)&lt;/P&gt;
&lt;P&gt; case( WM_INITDIALOG)&lt;/P&gt;
&lt;P&gt; ....&lt;/P&gt;
&lt;P&gt;  BurnerTab=1&lt;/P&gt;
&lt;P&gt;  return&lt;/P&gt;
&lt;P&gt; case (WM_COMMAND)&lt;/P&gt;
&lt;P&gt; select case (LOWORD(uParam))&lt;/P&gt;
&lt;P&gt; case (IDOK,ID_ESCAPE)  &lt;/P&gt;
&lt;P&gt; ....     &lt;/P&gt;
&lt;P&gt;  end select&lt;/P&gt;
&lt;P&gt; case(WM_move) &lt;/P&gt;
&lt;P&gt; ....&lt;/P&gt;
&lt;P&gt; ....&lt;/P&gt;
&lt;P&gt; return         &lt;/P&gt;
&lt;P&gt;end select&lt;/P&gt;
&lt;P&gt;BurnerTab=0 &lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;end function BurnerTab&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The source code of the main program part that used this dll is :&lt;/P&gt;
&lt;P&gt;integer*4 function BurnersPreprocessing(BurnerTyp)&lt;/P&gt;
&lt;P&gt; !DEC$ IF DEFINED(_X86_)&lt;/P&gt;
&lt;P&gt; !DEC$ ATTRIBUTES STDcall, ALIAS : '_BurnersPreprocessing@16' :: BurnersPreprocessing&lt;/P&gt;
&lt;P&gt; !DEC$ ELSE&lt;/P&gt;
&lt;P&gt; !DEC$ ATTRIBUTES STDcall, ALIAS : 'BurnersPreprocessing' :: BurnersPreprocessing&lt;/P&gt;
&lt;P&gt; !DEC$ ENDIF&lt;/P&gt;
&lt;P&gt; use user32&lt;/P&gt;
&lt;P&gt; use kernel32&lt;/P&gt;
&lt;P&gt; use comctl32&lt;/P&gt;
&lt;P&gt; use DFWIN&lt;/P&gt;
&lt;P&gt; use THESSGlobals&lt;/P&gt;
&lt;P&gt; use HeatLibDrawingVar&lt;/P&gt;
&lt;P&gt; use MDI_WindowsVar&lt;/P&gt;
&lt;P&gt; use FuelClass&lt;/P&gt;
&lt;P&gt; implicit none&lt;/P&gt;
&lt;P&gt; include 'resource.fd'&lt;/P&gt;
&lt;P&gt; integer iret&lt;/P&gt;
&lt;P&gt; integer BurnerTyp&lt;/P&gt;
&lt;P&gt; logical bret&lt;/P&gt;
&lt;P&gt; integer(HANDLE) dll_handle(2)&lt;/P&gt;
&lt;P&gt; integer(BOOL) free_status&lt;/P&gt;
&lt;P&gt; pointer(p_ComponentBurner, ComponentBurner)&lt;/P&gt;
&lt;P&gt; interface&lt;/P&gt;
&lt;P&gt; integer*4 function ComponentBurner(BurnerTyp,GlobalIcon)&lt;/P&gt;
&lt;P&gt; !DEC$ ATTRIBUTES DLLIMPORT::ComponentBurner&lt;/P&gt;
&lt;P&gt; integer BurnerTyp&lt;/P&gt;
&lt;P&gt; integer GlobalIcon &lt;/P&gt;
&lt;P&gt; end function ComponentBurner&lt;/P&gt;
&lt;P&gt; end interface&lt;/P&gt;
&lt;P&gt; dll_handle(1) = LoadLibrary ("BurnersClass.dll"C)&lt;/P&gt;
&lt;P&gt; if (dll_handle(1) == NULL) then&lt;/P&gt;
&lt;P&gt; ! Failure&lt;/P&gt;
&lt;P&gt; stop&lt;/P&gt;
&lt;P&gt; end if&lt;/P&gt;
&lt;P&gt; p_ComponentBurner = GetProcAddress (dll_handle(1), "ComponentBurner"C)&lt;/P&gt;
&lt;P&gt; if (p_ComponentBurner == NULL) then&lt;/P&gt;
&lt;P&gt; ! Failure&lt;/P&gt;
&lt;P&gt; stop&lt;/P&gt;
&lt;P&gt; end if  &lt;/P&gt;
&lt;P&gt; iret = ComponentBurner(BurnerTyp,GlobalIcon,IDD_component_tab)&lt;/P&gt;
&lt;P&gt; BurnersPreprocessing=0&lt;/P&gt;
&lt;P&gt; return&lt;/P&gt;
&lt;P&gt;end function BurnersPreprocessing&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;When I debug the main program and I execute the line code :&lt;/P&gt;
&lt;P&gt;BurnerMenu%handle=CreateDialogParam(HandleAndInstance%ghInstance,IDD_Component_Tab, &amp;amp;&lt;/P&gt;
&lt;P&gt;  MDI_WINDOW_Current%Handle, loc(BurnerTab),0)&lt;/P&gt;
&lt;P&gt;I receive the message : Unhandelded exception in Main.exe (called BurnersClass.dll):0x000005:Acces Violation.&lt;/P&gt;
&lt;P&gt;And inside the DLL when I check the values of the function BurnerTab arguments : hDlg message, uParam, lParam I obtains :&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;hDlg = Undefined Adress&lt;/P&gt;
&lt;P&gt;message = Undefined Adress&lt;/P&gt;
&lt;P&gt;uParam = Undefined Adress&lt;/P&gt;
&lt;P&gt;lParam = Undefined Adress&lt;/P&gt;
&lt;P&gt;If you have a solution, or a simple example of using DLL with MDI project send it me&lt;/P&gt;
&lt;P&gt;thanks in advance&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jan 2009 08:24:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857482#M67922</guid>
      <dc:creator>moncef</dc:creator>
      <dc:date>2009-01-26T08:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using DLLs in MDI project</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857483#M67923</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/411710"&gt;moncef&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;P&gt;Iam using CVF to built an MDI project and I have a problem to call a Dialog Box written in a DLL wich is a subproject of the main project.&lt;/P&gt;
&lt;P&gt;The source code of the DLL called BurnersClass.dll is :&lt;/P&gt;
&lt;P&gt;integer*4 function ComponentBurner(BurnerTyp,GlobalIcon)&lt;/P&gt;
&lt;P&gt;...&lt;SNIP&gt;&lt;/SNIP&gt;&lt;/P&gt;
&lt;P&gt;iret = ComponentBurner(BurnerTyp,GlobalIcon,IDD_component_tab)&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;I don't think that it has anything to do with MDI, and even dll could easily be a red herring. The symptoms match a fandango on stack rather than a dll problem.&lt;BR /&gt;&lt;BR /&gt;However, I wonder: how come that the actual function ComponentBurner has 2 arguments, its INTERFACE has 2 arguments, and yet you call it with 3? &lt;BR /&gt;</description>
      <pubDate>Mon, 26 Jan 2009 09:41:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857483#M67923</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2009-01-26T09:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using DLLs in MDI project</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857484#M67924</link>
      <description>&lt;BR /&gt;Thank you for your remarks.&lt;BR /&gt;&lt;BR /&gt;I corrected the number of arguments of the ComponentBurner function. however, the problem persists.&lt;BR /&gt;&lt;BR /&gt;I think that the problem is the transmission of the parameters hDlg, message, Uparam, Lparam &lt;BR /&gt;&lt;BR /&gt;Therese it a specialcompilations which make it possible to carry out this transfer of information between the DLL and project MDI?. &lt;BR /&gt;&lt;BR /&gt;Altogether, the DLL is not other than Child window of the project MDI.&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Jan 2009 10:54:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857484#M67924</guid>
      <dc:creator>moncef</dc:creator>
      <dc:date>2009-01-27T10:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using DLLs in MDI project</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857485#M67925</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/411710"&gt;moncef&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;&lt;BR /&gt;Therese it a specialcompilations which make it possible to carry out this transfer of information between the DLL and project MDI?. &lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;No. It should just work if you declared everything correctly.&lt;BR /&gt;&lt;BR /&gt;Further, I'm not sure if you just posted code fragments or is that really your code. For example, the previous error with wrong number of arguments should have caused a compile-time error, yet you say that you were able to run the program?&lt;BR /&gt;&lt;BR /&gt;Another suspicious place is:&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;BurnerMenu%handle=CreateDialogParam(HandleAndInstance%ghInstance,IDD_Component_Tab, &amp;amp;&lt;BR /&gt;&lt;BR /&gt; MDI_WINDOW_Current%Handle, &lt;STRONG&gt;loc(BurnerTab)&lt;/STRONG&gt;,0) &lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;You don't have IMPLICIT NONE there, do you? And I don't see either declaration of INTERFACE to BurnerTab in the ComponentBurner. How is compiler supposed to know that loc(BurnerTab) refers to address of a function, not of a local REAL variable? You need either INTERFACE to BurnerTab, or both of these contained in a MODULE. But that doesn't have anything to do with dlls.&lt;BR /&gt;&lt;BR /&gt;In short, it's difficult to say what is the error unless the posted code does not match the original one. But again, it should just work if you coded everything corrrectly.&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Jan 2009 16:09:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857485#M67925</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2009-01-27T16:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using DLLs in MDI project</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857486#M67926</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;P&gt;I showed only fraction of code concerned with the problem. Being given the fact that I cannot send the entirety of the code : it isnt a problem of confidentiality but it is very long. Here is a simple case which poses the same problem:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The DLL's source code:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;MODULE MDIDIALOG&lt;/P&gt;
&lt;P&gt;integer, private:: iret&lt;/P&gt;
&lt;P&gt;Contains&lt;/P&gt;
&lt;P&gt;integer*4 function DialgCallBack( hDlg,message,uParam,lParam )&lt;/P&gt;
&lt;P&gt;!DEC$ ATTRIBUTES STDCALL, REFERENCE,ALIAS :"DialgCallBack":: DialgCallBack&lt;/P&gt;
&lt;P&gt;!DEC$ ATTRIBUTES DLLEXPORT::DialgCallBack&lt;/P&gt;
&lt;P&gt; use comctl32&lt;/P&gt;
&lt;P&gt; use DFWIN&lt;/P&gt;
&lt;P&gt; use user32&lt;/P&gt;
&lt;P&gt; use kernel32&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt; Implicit None&lt;/P&gt;
&lt;P&gt; include 'RESOURCE.fd'  &lt;/P&gt;
&lt;P&gt; integer hDlg&lt;/P&gt;
&lt;P&gt; integer message&lt;/P&gt;
&lt;P&gt; integer uparam&lt;/P&gt;
&lt;P&gt; integer lparam&lt;/P&gt;
&lt;P&gt; select case(message)&lt;/P&gt;
&lt;P&gt; case( WM_INITDIALOG)&lt;/P&gt;
&lt;P&gt;  DialgCallBack=1&lt;/P&gt;
&lt;P&gt; return&lt;/P&gt;
&lt;P&gt;  case (WM_COMMAND)&lt;/P&gt;
&lt;P&gt;  select case (LOWORD(uParam)) &lt;/P&gt;
&lt;P&gt; case(IDOK)&lt;/P&gt;
&lt;P&gt; iret=1&lt;/P&gt;
&lt;P&gt; end select&lt;/P&gt;
&lt;P&gt;  DialgCallBack=1&lt;/P&gt;
&lt;P&gt;  return &lt;/P&gt;
&lt;P&gt; end select&lt;/P&gt;
&lt;P&gt; DialgCallBack=0 &lt;/P&gt;
&lt;P&gt; return&lt;/P&gt;
&lt;P&gt; end function DialgCallBack&lt;/P&gt;
&lt;P&gt; subroutine guetter(IDD_dialog)&lt;/P&gt;
&lt;P&gt; !DEC$ ATTRIBUTES STDCALL, REFERENCE,ALIAS :"guetter":: guetter&lt;/P&gt;
&lt;P&gt; !DEC$ ATTRIBUTES DLLEXPORT::guetter&lt;/P&gt;
&lt;P&gt;  include 'RESOURCE.fd'&lt;/P&gt;
&lt;P&gt; integer IDD_dialog&lt;/P&gt;
&lt;P&gt; IDD_dialog=IDD_ImportedDialog&lt;/P&gt;
&lt;P&gt; return&lt;/P&gt;
&lt;P&gt; end subroutine&lt;/P&gt;
&lt;P&gt;END MODULE MDIDIALOG&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Main program (MDI_UsingDlls) source code:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;!**************************************************************************&lt;/P&gt;
&lt;P&gt;! FUNCTION: MainWndProc ( hWnd, mesg, wParam, lParam )&lt;/P&gt;
&lt;P&gt;! PURPOSE: Processes messages for the main window&lt;/P&gt;
&lt;P&gt;! COMMENTS:&lt;/P&gt;
&lt;P&gt;!**************************************************************************&lt;/P&gt;
&lt;P&gt;integer function MainWndProc ( hWnd, mesg, wParam, lParam )&lt;/P&gt;
&lt;P&gt;!DEC$ IF DEFINED(_X86_)&lt;/P&gt;
&lt;P&gt;!DEC$ ATTRIBUTES STDCALL, ALIAS : '_MainWndProc@16' :: MainWndProc&lt;/P&gt;
&lt;P&gt;!DEC$ ELSE&lt;/P&gt;
&lt;P&gt;!DEC$ ATTRIBUTES STDCALL, ALIAS : 'MainWndProc' :: MainWndProc&lt;/P&gt;
&lt;P&gt;!DEC$ ENDIF&lt;/P&gt;
&lt;P&gt; use user32&lt;/P&gt;
&lt;P&gt; use kernel32&lt;/P&gt;
&lt;P&gt; use dfwbase&lt;/P&gt;
&lt;P&gt; use MDI_UsingDllsGlobals&lt;/P&gt;
&lt;P&gt; implicit none&lt;/P&gt;
&lt;P&gt; integer*4 hWnd&lt;/P&gt;
&lt;P&gt; integer*4 mesg&lt;/P&gt;
&lt;P&gt; integer*4 wParam&lt;/P&gt;
&lt;P&gt; integer*4 lParam&lt;/P&gt;
&lt;P&gt; include 'resource.fd'&lt;/P&gt;
&lt;P&gt; interface&lt;/P&gt;
&lt;P&gt; integer*4 function AboutDlgProc( hwnd, mesg, wParam, lParam )&lt;/P&gt;
&lt;P&gt; !DEC$ IF DEFINED(_X86_)&lt;/P&gt;
&lt;P&gt; !DEC$ ATTRIBUTES STDCALL, ALIAS : '_AboutDlgProc@16' :: AboutDlgProc&lt;/P&gt;
&lt;P&gt; !DEC$ ELSE&lt;/P&gt;
&lt;P&gt; !DEC$ ATTRIBUTES STDCALL, ALIAS : 'AboutDlgProc' :: AboutDlgProc&lt;/P&gt;
&lt;P&gt; !DEC$ ENDIF&lt;/P&gt;
&lt;P&gt; integer*4 hwnd&lt;/P&gt;
&lt;P&gt; integer*4 mesg&lt;/P&gt;
&lt;P&gt; integer*4 wParam&lt;/P&gt;
&lt;P&gt; integer*4 lParam&lt;/P&gt;
&lt;P&gt; end function&lt;/P&gt;
&lt;P&gt; end interface&lt;/P&gt;
&lt;P&gt; ! Variables&lt;/P&gt;
&lt;P&gt; type (T_CLIENTCREATESTRUCT) clientcreate&lt;/P&gt;
&lt;P&gt; type (T_MDICREATESTRUCT) mdicreate&lt;/P&gt;
&lt;P&gt; integer*4 hwndChildWindow&lt;/P&gt;
&lt;P&gt; integer*4 hInfo&lt;/P&gt;
&lt;P&gt; integer*4 pInfo&lt;/P&gt;
&lt;P&gt; type (PERWNDINFO) Info&lt;/P&gt;
&lt;P&gt; integer*4 hActiveChild&lt;/P&gt;
&lt;P&gt; character(SIZEOFAPPNAME) lpszTitle, lpszCaption&lt;/P&gt;
&lt;P&gt; logical*4 lret&lt;/P&gt;
&lt;P&gt; integer*4 ret&lt;/P&gt;
&lt;P&gt; character(SIZEOFAPPNAME) lpszName, lpszHelpFileName, lpszContents, lpszMessage&lt;/P&gt;
&lt;P&gt; character(SIZEOFAPPNAME) lpszHeader&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;STRONG&gt;integer dllDialog_handle &lt;/STRONG&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; integer dialogH &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; pointer(P_DialgCallBack,DialgCallBack) &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; pointer(P_guetter,guetter) &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; interface &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; integer*4 function DialgCallBack( hDlg,message,uParam,lParam )&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; !DEC$ ATTRIBUTES DLLIMPORT::DialgCallBack &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; integer hDlg&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; integer message&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; integer uparam&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; integer lparam&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; end function DialgCallBack&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; end interface &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;interface &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; subroutine guetter(IDD_dialog)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; !DEC$ ATTRIBUTES STDCALL, REFERENCE,ALIAS :"guetter":: guetter&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; !DEC$ ATTRIBUTES DLLIMPORT::guetter&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; integer IDD_dialog&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; end subroutine &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; end interface &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;STRONG&gt;dllDialog_handle = LoadLibrary ("DialogDll.dll"C) &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if (dllDialog_handle == NULL) then&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; ! Failure&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; stop&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; end if &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; P_DialgCallBack =GetProcAddress (dllDialog_handle, "DialgCallBack"C)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if (P_DialgCallBack == NULL) then&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; ! Failure&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; stop&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; end if &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; P_guetter =GetProcAddress (dllDialog_handle, "guetter"C)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if (P_guetter == NULL) then&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; ! Failure&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; stop&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; end if &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; !===========================================&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; select case ( mesg )&lt;/P&gt;
&lt;P&gt; ! WM_CREATE: Create the MDICLIENT window which contains the MDI children&lt;/P&gt;
&lt;P&gt; case (WM_CREATE)&lt;/P&gt;
&lt;P&gt; lpszName = "MDICLIENT"C&lt;/P&gt;
&lt;P&gt; clientcreate%hWindowMenu = ghMenuWindow&lt;/P&gt;
&lt;P&gt; clientcreate%idFirstChild = 1&lt;/P&gt;
&lt;P&gt; ghwndClient = CreateWindow(lpszName, ""C, &amp;amp;&lt;/P&gt;
&lt;P&gt; IOR(WS_CHILD, IOR(WS_CLIPCHILDREN, WS_VISIBLE)),&amp;amp;&lt;/P&gt;
&lt;P&gt; 0, 0, 0, 0, &amp;amp;&lt;/P&gt;
&lt;P&gt; hwnd, NULL, ghInstance, &amp;amp;&lt;/P&gt;
&lt;P&gt; LOC(clientcreate))&lt;/P&gt;
&lt;P&gt; MainWndProc = 0&lt;/P&gt;
&lt;P&gt; return&lt;/P&gt;
&lt;P&gt; ! WM_DESTROY: PostQuitMessage() is called&lt;/P&gt;
&lt;P&gt; case (WM_DESTROY)&lt;/P&gt;
&lt;P&gt; call PostQuitMessage( 0 )&lt;/P&gt;
&lt;P&gt; MainWndProc = 0&lt;/P&gt;
&lt;P&gt; return&lt;/P&gt;
&lt;P&gt; ! WM_COMMAND: user command&lt;/P&gt;
&lt;P&gt; case (WM_COMMAND)&lt;/P&gt;
&lt;P&gt; select case ( IAND(wParam, 16#ffff ) )&lt;/P&gt;
&lt;P&gt; case(&lt;STRONG&gt;IDM_RunDialog&lt;/STRONG&gt;)&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;  call guetter(IDD_Component_Tab)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;  dialogH=CreateDialogParam(ghInstance,IDD_Component_Tab,&amp;amp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;  hwnd,P_DialgCallBack,0) &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; ret=ShowWindow(dialogH,SW_SHOW)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt; MainWndProc = 0&lt;/P&gt;
&lt;P&gt; return&lt;/P&gt;
&lt;P&gt; case DEFAULT&lt;/P&gt;
&lt;P&gt; MainWndProc = DefFrameProc( hWnd, ghwndClient, mesg, wParam, lParam )&lt;/P&gt;
&lt;P&gt; return&lt;/P&gt;
&lt;P&gt; end select&lt;/P&gt;
&lt;P&gt; ! Let the default window proc handle all other messages&lt;/P&gt;
&lt;P&gt; case default&lt;/P&gt;
&lt;P&gt; MainWndProc = DefFrameProc( hWnd, ghwndClient, mesg, wParam, lParam )&lt;/P&gt;
&lt;P&gt; end select&lt;/P&gt;
&lt;P&gt;end&lt;/P&gt;
&lt;P&gt;When I debug the main program and I execute the line code: &lt;BR /&gt;dialogH=CreateDialogParam(ghInstance,IDD_Component_Tab, hwnd,P_DialgCallBack,0), likein the preceding exemple I receive the message : Unhandelded exception in Main.exe (called BurnersClass.dll):0x000005:Acces Violation. And inside the DLL when I check the values of the function BurnerTab arguments : hDlg message, uParam, lParam I obtains :&lt;/P&gt;
&lt;P&gt;hDlg = Undefined Adress&lt;/P&gt;
&lt;P&gt;message = Undefined Adress&lt;/P&gt;
&lt;P&gt;uParam = Undefined Adress&lt;/P&gt;
&lt;P&gt;lParam = Undefined Adress&lt;BR /&gt;&lt;BR /&gt;It's my first experience in use of the DLLs wich contain Dialog, then thank you for your patience and your help to find a solution.&lt;/P&gt;
&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jan 2009 10:09:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857486#M67926</guid>
      <dc:creator>moncef</dc:creator>
      <dc:date>2009-01-28T10:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using DLLs in MDI project</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857487#M67927</link>
      <description>Can you instead zip and attach the relevant files (sources, project, .rc, .h)? &lt;A href="http://software.intel.com/en-us/forums/showannouncement.php?a=78"&gt;Here are the instructions&lt;/A&gt;.&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jan 2009 10:55:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857487#M67927</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2009-01-28T10:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using DLLs in MDI project</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857488#M67928</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/391180"&gt;Jugoslav Dujic&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;Can you instead zip and attach the relevant files (sources, project, .rc, .h)? &lt;A href="http://software.intel.com/en-us/forums/showannouncement.php?a=78"&gt;Here are the instructions&lt;/A&gt;.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;I send you the totality of the project ( MDI and DLL)</description>
      <pubDate>Wed, 28 Jan 2009 12:40:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857488#M67928</guid>
      <dc:creator>moncef</dc:creator>
      <dc:date>2009-01-28T12:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using DLLs in MDI project</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857489#M67929</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/411710"&gt;moncef&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;I send you the totality of the project ( MDI and DLL)&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;No you didn't (seem to). Please re-check the link above -- you probably didn't perform Step 7 ("Add as attachment")&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jan 2009 13:29:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857489#M67929</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2009-01-28T13:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using DLLs in MDI project</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857490#M67930</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/391180"&gt;Jugoslav Dujic&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;No you didn't (seem to). Please re-check the link above -- you probably didn't perform Step 7 ("Add as attachment")&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Excuse me i forget to perform step 7.</description>
      <pubDate>Wed, 28 Jan 2009 14:03:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857490#M67930</guid>
      <dc:creator>moncef</dc:creator>
      <dc:date>2009-01-28T14:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using DLLs in MDI project</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857491#M67931</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/411710"&gt;moncef&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;BR /&gt;Excuse me i forget to perform step 7.&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;1) You had a copy of DialogDll.dll in the root folder. Don't copy files manually -- it's a recipe for disaster when you forget to do the copying. Instead, go to Project Settings/General/Output files for the dll, and type "../Debug" (or ../Release). In this way, the dll will be automatically created in the MDI_UsingDllsDebug folder. Delete the one from the root folder&lt;BR /&gt;&lt;BR /&gt;2) You don't need reference here:&lt;BR /&gt;!DEC$ ATTRIBUTES STDCALL, &lt;SPAN style="text-decoration: line-through;"&gt;REFERENCE&lt;/SPAN&gt;,ALIAS :"DialgCallBack":: DialgCallBack&lt;BR /&gt;&lt;BR /&gt;3) Don't LoadLibrary on every entry to MainWndProc (it's not actively harmful, but you increase reference count to infinity). You can do it either on WM_CREATE (you need to SAVE dllDialog_handle in that case), or on IDM_RunDialog. It's nice if you also call FreeLibrary when you don't need it.&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jan 2009 14:44:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857491#M67931</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2009-01-28T14:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using DLLs in MDI project</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857492#M67932</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/391180"&gt;Jugoslav Dujic&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;&lt;BR /&gt;1) You had a copy of DialogDll.dll in the root folder. Don't copy files manually -- it's a recipe for disaster when you forget to do the copying. Instead, go to Project Settings/General/Output files for the dll, and type "../Debug" (or ../Release). In this way, the dll will be automatically created in the MDI_UsingDllsDebug folder. Delete the one from the root folder&lt;BR /&gt;&lt;BR /&gt;2) You don't need reference here:&lt;BR /&gt;!DEC$ ATTRIBUTES STDCALL, &lt;SPAN style="text-decoration: line-through;"&gt;REFERENCE&lt;/SPAN&gt;,ALIAS :"DialgCallBack":: DialgCallBack&lt;BR /&gt;&lt;BR /&gt;3) Don't LoadLibrary on every entry to MainWndProc (it's not actively harmful, but you increase reference count to infinity). You can do it either on WM_CREATE (you need to SAVE dllDialog_handle in that case), or on IDM_RunDialog. It's nice if you also call FreeLibrary when you don't need it.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;it works now. Thank you very much for your help.</description>
      <pubDate>Wed, 28 Jan 2009 17:10:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-DLLs-in-MDI-project/m-p/857492#M67932</guid>
      <dc:creator>moncef</dc:creator>
      <dc:date>2009-01-28T17:10:14Z</dc:date>
    </item>
  </channel>
</rss>

