<?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 Possible to use VB Generated DLL in Fortran? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787715#M30928</link>
    <description>Almost certainly one can use the DLL, but how difficult it would be depends on what kind of DLL it is. If it's a native (non-managed DLL), it's fairly easy. If it's a managed DLL, then one would use the Fortran Module Wizard tool to create interfaces to the DLL routines.&lt;BR /&gt;&lt;BR /&gt;Can you attach a sample DLL here so I can take a look? It would help if you gave me the Delphi or VB declaration of the routine with its arguments and types of arguments.</description>
    <pubDate>Sat, 07 Jul 2012 14:25:33 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2012-07-07T14:25:33Z</dc:date>
    <item>
      <title>Possible to use VB Generated DLL in Fortran?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787714#M30927</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I have binary files generated by Delphi application, and have the VB code to read it. Since Fortran's binary format is different, I think of making the DLL in VB and use in Fortran. So, I would like to knowwhether CVF/ifort have options to use VB generated DLL or not.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Mohan</description>
      <pubDate>Sat, 07 Jul 2012 06:19:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787714#M30927</guid>
      <dc:creator>mohanmuthu</dc:creator>
      <dc:date>2012-07-07T06:19:10Z</dc:date>
    </item>
    <item>
      <title>Possible to use VB Generated DLL in Fortran?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787715#M30928</link>
      <description>Almost certainly one can use the DLL, but how difficult it would be depends on what kind of DLL it is. If it's a native (non-managed DLL), it's fairly easy. If it's a managed DLL, then one would use the Fortran Module Wizard tool to create interfaces to the DLL routines.&lt;BR /&gt;&lt;BR /&gt;Can you attach a sample DLL here so I can take a look? It would help if you gave me the Delphi or VB declaration of the routine with its arguments and types of arguments.</description>
      <pubDate>Sat, 07 Jul 2012 14:25:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787715#M30928</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-07-07T14:25:33Z</dc:date>
    </item>
    <item>
      <title>Possible to use VB Generated DLL in Fortran?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787717#M30930</link>
      <description>&lt;P&gt;Hi Steve,&lt;BR /&gt;&lt;BR /&gt;Initially I created the DLL with vb6 (unmanaged), but then I thought it would be good idea to start a test problem. Following are the codes. I created "Test_Add.dll" from VB and attached to CVF through Project -&amp;gt; Add to Project -&amp;gt; Files&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;VB code:&lt;/STRONG&gt;&lt;/P&gt;&lt;SPAN style="font-family: Consolas; color: #0000ff; font-size: x-small;"&gt;&lt;SPAN style="font-family: Consolas; color: #0000ff; font-size: x-small;"&gt;&lt;SPAN style="font-family: Consolas; color: #0000ff; font-size: x-small;"&gt;&lt;SPAN style="font-family: Consolas; color: #0000ff; font-size: x-small;"&gt;&lt;SPAN style="font-family: Consolas; color: #0000ff; font-size: x-small;"&gt;&lt;SPAN style="font-family: Consolas; color: #0000ff; font-size: x-small;"&gt;&lt;P&gt;&lt;SPAN class="sectionBodyText"&gt;Public&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN class="sectionBodyText"&gt;Public Function test_add(ByVal a1 As Integer, ByVal a2 As Integer) As Integer&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN class="sectionBodyText"&gt;&lt;BR /&gt; test_add = a1 + a2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="sectionBodyText"&gt;End Function&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; color: #0000ff; font-size: x-small;"&gt;&lt;SPAN style="font-family: Consolas; color: #0000ff; font-size: x-small;"&gt;&lt;SPAN style="font-family: Consolas; color: #0000ff; font-size: x-small;"&gt;&lt;SPAN style="font-family: Consolas; color: #0000ff; font-size: x-small;"&gt;&lt;SPAN style="font-family: Consolas; color: #0000ff; font-size: x-small;"&gt;&lt;SPAN style="font-family: Consolas; color: #0000ff; font-size: x-small;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="sectionBodyText"&gt;End&lt;/SPAN&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="sectionBodyText"&gt;Class&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;CVF 6.6 code:&lt;BR /&gt;&lt;/STRONG&gt;Program Test&lt;/P&gt;&lt;P&gt; !IMPLICIT NONE&lt;/P&gt;&lt;P&gt; !DEC$ ATTRIBUTES DLLIMPORT :: test_add&lt;BR /&gt; !DEC$ ATTRIBUTES STDCALL :: test_add&lt;BR /&gt;!DEC$ ATTRIBUTES ALIAS:'_TEST_ADD@8':: test_add&lt;/P&gt;&lt;P&gt; INTEGER :: i1,i2,i3&lt;/P&gt;&lt;P&gt; WRITE(*,*) 'Enter two integers'&lt;BR /&gt; READ(*,*) i1,i2&lt;/P&gt;&lt;P&gt; i3=test_add(i1,i2)&lt;BR /&gt; write(*,*) i3&lt;/P&gt;&lt;P&gt;End Program Test&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;CVF Error:&lt;BR /&gt;&lt;/STRONG&gt;Compiling Fortran...&lt;BR /&gt;..\Test\Test.f90&lt;BR /&gt;Linking...&lt;BR /&gt;Test.obj : error LNK2001: unresolved external symbol &lt;A href="mailto:_TEST_ADD@8"&gt;_TEST_ADD@8&lt;/A&gt;&lt;BR /&gt;Debug/Test.exe : fatal error LNK1120: 1 unresolved externals&lt;BR /&gt;Error executing link.exe.&lt;/P&gt;&lt;P&gt;Test.exe - 2 error(s), 0 warning(s)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;SPAN class="sectionBodyText"&gt;Class Class1&lt;/SPAN&gt;</description>
      <pubDate>Mon, 09 Jul 2012 05:28:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787717#M30930</guid>
      <dc:creator>mohanmuthu</dc:creator>
      <dc:date>2012-07-09T05:28:09Z</dc:date>
    </item>
    <item>
      <title>Possible to use VB Generated DLL in Fortran?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787718#M30931</link>
      <description>Oh, you're using CVF...&lt;BR /&gt;&lt;BR /&gt;There are two problems you have. The first is that the name of the routine in VB is 'test_add', not '_TEST_ADD@8'. Yes, the latter would be what CVF would use for a Fortran routine, but VB does things its own way. The second problem is that you don't have an export library to link against - you can't link to a DLL. So instead you could use the Win32 API routines LoadLibrary and GetProcAddress to call the routine. If I recall correctly, CVF has a DLL\LoadLibrary sample illustrating how this is done.</description>
      <pubDate>Mon, 09 Jul 2012 14:59:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787718#M30931</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-07-09T14:59:04Z</dc:date>
    </item>
    <item>
      <title>Possible to use VB Generated DLL in Fortran?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787719#M30932</link>
      <description>Steve,&lt;BR /&gt;I would also like to call a vb.net managed dll from Intel Fortran. I made the dll "COM visible" and used the Module Wizzard based on the steps mentioned here: &lt;A href="http://software.intel.com/en-us/forums/showpost.php?p=135683" target="_blank"&gt;http://software.intel.com/en-us/forums/showpost.php?p=135683&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Then performed the REGASM step.&lt;BR /&gt;&lt;BR /&gt;In my Fortran program I imported the module with a use statement.&lt;BR /&gt;&lt;BR /&gt;Is this all I need to do to acess the DLL? Or do I need to reference something in the Project's linker settings?&lt;BR /&gt;&lt;BR /&gt;With the following code I get the following error message Unhandled exception at 0x00000000 in TestNetDll.exe: 0xC0000005: Access violation.&lt;BR /&gt;[fortran]program TestNetDll
use BDataObj

implicit none

! Variables
integer(4) :: func4
		
! Body of TestNetDll
func4 =  AnInterface_ClearKeyBuffer(NULL)
		
end program TestNetDll[/fortran]</description>
      <pubDate>Thu, 12 Jul 2012 19:32:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787719#M30932</guid>
      <dc:creator>daninraleigh</dc:creator>
      <dc:date>2012-07-12T19:32:39Z</dc:date>
    </item>
    <item>
      <title>Possible to use VB Generated DLL in Fortran?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787720#M30933</link>
      <description>Typically you at least need to call COMINITIALIZE first. But without seeing all of what you're doing, I couldn't begin to guess where the problem might be. I assume that AnInterface_ClearKeyBuffer is a routine generated by the module wizard. You could step into it in the debugger and see how far you get before the error. I am not sure what NULL is here in this context, or how it is interpreted by the routine you call.</description>
      <pubDate>Thu, 12 Jul 2012 19:42:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787720#M30933</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-07-12T19:42:37Z</dc:date>
    </item>
    <item>
      <title>Possible to use VB Generated DLL in Fortran?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787721#M30934</link>
      <description>Sorry, I did not follow the directions fully. The accompanying Fortran code does have all of that listed in there.&lt;BR /&gt;&lt;BR /&gt;Again, sorry.</description>
      <pubDate>Thu, 12 Jul 2012 21:01:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787721#M30934</guid>
      <dc:creator>daninraleigh</dc:creator>
      <dc:date>2012-07-12T21:01:41Z</dc:date>
    </item>
    <item>
      <title>Possible to use VB Generated DLL in Fortran?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787716#M30929</link>
      <description>CanI suggest that you use a VB application to call your DLL and then pass the data as required to a Fortran DLL, a lot easier and the code exists in the samples. Uisng the Fortran Wizard can waste a lot of time and not end up with a usable product. &lt;BR /&gt;&lt;BR /&gt;Managed DLL's are not a great problem, if yours is non managed you can make it managed using a simple trick from Microsoft - create small small managed app then add your dll to the small one and it will make it managed and then just register it.&lt;BR /&gt;&lt;BR /&gt;JMN&lt;BR /&gt;&lt;BR /&gt;[bash]cd B:UsersJohnDocumentsVisual Studio 2010ProjectsbManagedDLLbManagedDLLbinDebug
RegAsm.exe bManagedDLL.dll /tlb:bManagedDLL.tlb /codebase
copy "*.tlb" "B:UsersJohnDocumentsVisual Studio 2010ProjectsCPPClientCPPClient*.tlb"
erase *.txt
cd 
pause&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[/bash]</description>
      <pubDate>Mon, 09 Jul 2012 01:05:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Possible-to-use-VB-Generated-DLL-in-Fortran/m-p/787716#M30929</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2012-07-09T01:05:38Z</dc:date>
    </item>
  </channel>
</rss>

