<?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 using .net dll in visual fortran in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782442#M28430</link>
    <description>My post was aimed at the original poster.</description>
    <pubDate>Mon, 29 Nov 2010 10:02:16 GMT</pubDate>
    <dc:creator>anthonyrichards</dc:creator>
    <dc:date>2010-11-29T10:02:16Z</dc:date>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782425#M28413</link>
      <description>hi there.&lt;BR /&gt;&lt;BR /&gt;first of all i have to say that my english is not the best so please be patient hehe.&lt;BR /&gt;&lt;BR /&gt;now to my problem:&lt;BR /&gt;normallyi am a .net developer so i am completely new to the fortran world.&lt;BR /&gt;but i have to learn it for my job :)&lt;BR /&gt;&lt;BR /&gt;i wrote a class library in vb.net to get,send and delete files from a server over ssh. in vb.net the library works well.&lt;BR /&gt;&lt;BR /&gt;now i want to use this dll. within fortran and so i wrote an interface to load the dll and uses the specific methods.&lt;BR /&gt;heres the code example i already wrote as an console application:&lt;BR /&gt;-----------------------------&lt;BR /&gt;&lt;P&gt;program test&lt;/P&gt;&lt;P&gt;use dfwin, only: LoadLibrary, GetProcAddress&lt;/P&gt;&lt;P&gt;integer(INT_PTR_KIND()) hk32Lib&lt;/P&gt;&lt;P&gt;interface&lt;/P&gt;&lt;P&gt;function SendFileToSSH (host,port,user,passWord,path,fileName,loadFromPath) Result (res)&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES STDCALL, DECORATE, ALIAS : 'SendFileToSSH' :: SendFileToSSH&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES REFERENCE :: host&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES REFERENCE :: port&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES REFERENCE :: user&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES REFERENCE :: passWord&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES REFERENCE :: fileName&lt;/P&gt;&lt;P&gt;!DEC$ ATTRIBUTES REFERENCE :: loadFromPath&lt;/P&gt;&lt;P&gt;! DEC$ ATTRIBUTES REFERENCE :: res&lt;/P&gt;&lt;P&gt;character(50) host&lt;/P&gt;&lt;P&gt;integer(4) port&lt;/P&gt;&lt;P&gt;character(50) user&lt;/P&gt;&lt;P&gt;character(50) passWord&lt;/P&gt;&lt;P&gt;character(256)fileName&lt;/P&gt;&lt;P&gt;character(50) loadFromPath&lt;/P&gt;&lt;P&gt;character(1024) res&lt;/P&gt;&lt;P&gt;end function SendFileToSSH&lt;/P&gt;&lt;P&gt;end interface&lt;/P&gt;&lt;P&gt;pointer(lpSendFileToSSH,SendFileToSSH)&lt;/P&gt;&lt;P&gt;hk32Lib=LoadLibrary("c:/temp/HandleSSH.dll"C)&lt;/P&gt;&lt;P&gt;lpSendFileToSSH = GetProcAddress(hk32Lib,"SendFileToSSH"C)&lt;/P&gt;&lt;P&gt;end program test&lt;BR /&gt;----------------&lt;BR /&gt;&lt;BR /&gt;if i debugs this code i can see that lpSendFileToSSH getting 0 as value which is probably wrong i think. &lt;BR /&gt;can you help me finding out what i have done wrong?&lt;BR /&gt;&lt;BR /&gt;best regards&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2010 10:28:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782425#M28413</guid>
      <dc:creator>ratzeputz</dc:creator>
      <dc:date>2010-11-19T10:28:59Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782426#M28414</link>
      <description>Apparently you have the name aliasing and decoration correct since your program clearly compiles and links OK.&lt;BR /&gt;&lt;BR /&gt;Try terminating all the string arguments with CHAR(0) and see if that works. Visual Basic expects and delivers null-terminated strings.</description>
      <pubDate>Fri, 19 Nov 2010 14:19:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782426#M28414</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2010-11-19T14:19:18Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782427#M28415</link>
      <description>Please show us the description of the SendFileToSSH routine from VB. I suspect that VB.NET wants a BSTRING rather than a normal character string. You'd have to call routines for creating BSTRINGs that can be found in module IFCOM (or DFCOM if you are using CVF.)</description>
      <pubDate>Fri, 19 Nov 2010 21:57:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782427#M28415</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-11-19T21:57:27Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782428#M28416</link>
      <description>Hi all and thank you all for your answers.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;The program itselfs compiles and links correct so there is no syntax error hehe.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;@Steve:&lt;/DIV&gt;&lt;DIV&gt;I am sorry but i cant copy the code to the Forum before wednesday. But what i can tell you is, that all parameters are expected as a vb.net string except for the port (its an 32bit integer), and the function returns a string with error message if there is any error or "success" if everything worked fine during the transfer.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;BSTRING means binary string right?&lt;/DIV&gt;&lt;DIV&gt;vb.net does support this as i can set the incoming parameters as a binary string and also can return the string as binary string.&lt;/DIV&gt;&lt;DIV&gt;am i right with my understanding?&lt;/DIV&gt;</description>
      <pubDate>Mon, 22 Nov 2010 07:18:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782428#M28416</guid>
      <dc:creator>ratzeputz</dc:creator>
      <dc:date>2010-11-22T07:18:58Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782429#M28417</link>
      <description>BSTR is a 'Bit string' which, for an n character string, as well as being stored as n characters as 2xn bytes, 2 per character (unicode I believe), stores the number of characters as 4 bytes immediately before the first character. So a BSTR consists of a 4-byte integer string length and a contiguous 2xn byte block of bytes encoding the characters.&lt;BR /&gt;&lt;BR /&gt;Regarding your problem,&lt;BR /&gt;&lt;BR /&gt;what value do you find for the handle given by LoadLibrary ? Is it a valid one i.e. was the library module found?&lt;BR /&gt;&lt;BR /&gt;ALso, do a DUMPBIN /EXPORTS on the DLL listing the exported symbols to check that you are asking for the correct symbol for the routine you want to load.</description>
      <pubDate>Mon, 22 Nov 2010 16:23:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782429#M28417</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2010-11-22T16:23:23Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782430#M28418</link>
      <description>hi again&lt;BR /&gt;&lt;BR /&gt;loadlibrary does deliver a value to the hk32Lib variable. it looks like an integer value&lt;BR /&gt;&lt;BR /&gt;here you have my vb.net function SendFileToSSH:&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;''' &lt;SUMMARY&gt;&lt;/SUMMARY&gt;&lt;/P&gt;&lt;P&gt;''' Sends a File to a SSH Server from a local Drive Directory&lt;/P&gt;&lt;P&gt;''' &lt;/P&gt;&lt;P&gt;''' &lt;OBJECT&gt;&lt;PARAM name="_host" /&gt;The SSH Server. It can be an Hostname or an IP Address as string&lt;/OBJECT&gt;&lt;/P&gt;&lt;P&gt;''' &lt;OBJECT&gt;&lt;PARAM name="_port" /&gt;The Port where the SSH Connection should go through as integer&lt;/OBJECT&gt;&lt;/P&gt;&lt;P&gt;''' &lt;OBJECT&gt;&lt;PARAM name="_user" /&gt;The Username to connect to SSH Server as string&lt;/OBJECT&gt;&lt;/P&gt;&lt;P&gt;''' &lt;OBJECT&gt;&lt;PARAM name="_passWord" /&gt;The Password to connect to SSH Server as string&lt;/OBJECT&gt;&lt;/P&gt;&lt;P&gt;''' &lt;OBJECT&gt;&lt;PARAM name="_path" /&gt;The Path where the file should be stored on the SSH Server as string&lt;/OBJECT&gt;&lt;/P&gt;&lt;P&gt;''' &lt;OBJECT&gt;&lt;PARAM name="_fileName " /&gt;The filename of the file which will be stored on the SSH Server as string.&lt;/OBJECT&gt;&lt;/P&gt;&lt;P&gt;''' &lt;OBJECT&gt;&lt;PARAM name="_loadFromPath " /&gt;The full Path of the File which should be uploaded to the SSH Server. NOTE: Must be like c:\temp\file.txt&lt;/OBJECT&gt;&lt;/P&gt;&lt;P&gt;''' &lt;RETURNS&gt;Any errormessage as String if anything went wrong. Otherwise Success&lt;/RETURNS&gt;&lt;/P&gt;&lt;P&gt;''' &lt;REMARKS&gt;&lt;/REMARKS&gt;&lt;/P&gt;&lt;P&gt;Public Shared Function SendFileToSSH(ByVal _host As String, ByVal _port As Integer, ByVal _user As String, ByVal _passWord As String, _&lt;/P&gt;&lt;P&gt;ByVal _path As String, ByVal _fileName As String, ByVal _loadFromPath As String) As String&lt;/P&gt;&lt;P&gt;' Important: It is helpful to send the contents of the&lt;/P&gt;&lt;P&gt;' sftp.LastErrorText property when requesting support.&lt;/P&gt;&lt;P&gt;Dim sftp As New Chilkat.SFtp()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;' Set some timeouts, in milliseconds:&lt;/P&gt;&lt;P&gt;sftp.ConnectTimeoutMs = 5000&lt;/P&gt;&lt;P&gt;sftp.IdleTimeoutMs = 10000&lt;/P&gt;&lt;P&gt;' Connect to the SSH server.&lt;/P&gt;&lt;P&gt;' The standard SSH port = 22&lt;/P&gt;&lt;P&gt;' The hostname may be a hostname or IP address.&lt;/P&gt;&lt;P&gt;Dim port As Long&lt;/P&gt;&lt;P&gt;Dim hostname As String&lt;/P&gt;&lt;P&gt;hostname = _host&lt;/P&gt;&lt;P&gt;port = _port&lt;/P&gt;&lt;P&gt;success = sftp.Connect(hostname, port)&lt;/P&gt;&lt;P&gt;If (success &amp;lt;&amp;gt; True) Then&lt;/P&gt;&lt;P&gt;Return (sftp.LastErrorText)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;' Authenticate with the SSH server. Chilkat SFTP supports&lt;/P&gt;&lt;P&gt;' both password-based authenication as well as public-key&lt;/P&gt;&lt;P&gt;' authentication. This example uses password authenication.&lt;/P&gt;&lt;P&gt;success = sftp.AuthenticatePw(_user, _passWord)&lt;/P&gt;&lt;P&gt;If (success &amp;lt;&amp;gt; True) Then&lt;/P&gt;&lt;P&gt;Return (sftp.LastErrorText)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;' After authenticating, the SFTP subsystem must be initialized:&lt;/P&gt;&lt;P&gt;success = sftp.InitializeSftp()&lt;/P&gt;&lt;P&gt;If (success &amp;lt;&amp;gt; True) Then&lt;/P&gt;&lt;P&gt;Return (sftp.LastErrorText)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;' Open a file for writing on the SSH server.&lt;/P&gt;&lt;P&gt;' If the file already exists, it is overwritten.&lt;/P&gt;&lt;P&gt;' (Specify "createNew" instead of "createTruncate" to&lt;/P&gt;&lt;P&gt;' prevent overwriting existing files.)&lt;/P&gt;&lt;P&gt;Dim handle As String&lt;/P&gt;&lt;P&gt;handle = sftp.OpenFile(_path &amp;amp; _fileName, "writeOnly", "createTruncate")&lt;/P&gt;&lt;P&gt;If (handle = vbNullString) Then&lt;/P&gt;&lt;P&gt;Return (sftp.LastErrorText)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;' Upload from the local file to the SSH server.&lt;/P&gt;&lt;P&gt;success = sftp.UploadFile(handle, _loadFromPath)&lt;/P&gt;&lt;P&gt;If (success &amp;lt;&amp;gt; True) Then&lt;/P&gt;&lt;P&gt;Return (sftp.LastErrorText)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;' Close the file.&lt;/P&gt;&lt;P&gt;success = sftp.CloseHandle(handle)&lt;/P&gt;&lt;P&gt;If (success &amp;lt;&amp;gt; True) Then&lt;/P&gt;&lt;P&gt;Return (sftp.LastErrorText)&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;Return "success"&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;</description>
      <pubDate>Wed, 24 Nov 2010 12:07:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782430#M28418</guid>
      <dc:creator>ratzeputz</dc:creator>
      <dc:date>2010-11-24T12:07:01Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782431#M28419</link>
      <description>i guess your thinking, that i did not get a value from the function by calling it.&lt;BR /&gt;&lt;BR /&gt;but the general problem is, that the function itself wont be found by calling GetProcAddress.&lt;BR /&gt;&lt;BR /&gt;calling this function always returns 0.&lt;BR /&gt;&lt;BR /&gt;i think that the main problem is, that vb.net does not make that .dll "open" to call it from outside the .net framework</description>
      <pubDate>Wed, 24 Nov 2010 12:42:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782431#M28419</guid>
      <dc:creator>ratzeputz</dc:creator>
      <dc:date>2010-11-24T12:42:56Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782432#M28420</link>
      <description>After doing a bit of reading around, I find that your VB .Net class library DLL does not export symbols, which is why you cannot find them with GetProcAddress.&lt;BR /&gt;&lt;BR /&gt;I disovered this method for using your class library via a C++ wrapper library detailed here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/10754d76-e1a3-4127-89a5-2f5a6b89598d" target="_blank"&gt;http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/10754d76-e1a3-4127-89a5-2f5a6b89598d&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Nov 2010 15:15:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782432#M28420</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2010-11-24T15:15:57Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782433#M28421</link>
      <description>You could also rewrite your code using Visual Basic, in which case you can create a Windows DLL from VB as described here (using ChilKatFtp2.dll instead of ChilKatDotnet2.dll)&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://windowsdevcenter.com/pub/a/windows/2005/04/26/create_dll.html?page=1" target="_blank"&gt;http://windowsdevcenter.com/pub/a/windows/2005/04/26/create_dll.html?page=1&lt;/A&gt;</description>
      <pubDate>Thu, 25 Nov 2010 17:12:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782433#M28421</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2010-11-25T17:12:19Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782434#M28422</link>
      <description>thx for your answers.&lt;BR /&gt;&lt;BR /&gt;wow...pretty hard stuff isnt it :)&lt;BR /&gt;&lt;BR /&gt;only thing i want to do is directly using ssh connection and transfer files over sftp out of fortran *cry* and theres no easy way to handle this *cry* :)&lt;BR /&gt;&lt;BR /&gt;well...i will read and search through your given links...maybe i will find any solution that works :)</description>
      <pubDate>Fri, 26 Nov 2010 07:41:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782434#M28422</guid>
      <dc:creator>ratzeputz</dc:creator>
      <dc:date>2010-11-26T07:41:52Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782435#M28423</link>
      <description>Well, you are trying to do something securely (as that is the purpose of ssh and sftp) and there is nothing easy about software security.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Fri, 26 Nov 2010 08:14:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782435#M28423</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2010-11-26T08:14:45Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782436#M28424</link>
      <description>yeah thats right but having some modules that brings the functionality with it would be a lot easier that switching between those programming languages.&lt;BR /&gt;&lt;BR /&gt;but there arent some modules available so doing this way will be the only way...even if its hard :)</description>
      <pubDate>Fri, 26 Nov 2010 08:22:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782436#M28424</guid>
      <dc:creator>ratzeputz</dc:creator>
      <dc:date>2010-11-26T08:22:11Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782437#M28425</link>
      <description>Hm, it might be an idea for my Flibs project (&lt;A href="http://flibs.sf.net"&gt;http://flibs.sf.net&lt;/A&gt;) - I just do not know what libraries to use &lt;BR /&gt;(yet). Indeed, a decent interface that can be used from a Fortran program would make this a lot more convenient.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Fri, 26 Nov 2010 08:25:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782437#M28425</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2010-11-26T08:25:41Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782438#M28426</link>
      <description>i think that would generally be a good idea cause i am sure, that much fortran developers would wish to have a ssh connection in there programs without those "hacking" "wrapping" "switching" methods :)&lt;BR /&gt;&lt;BR /&gt;youll get hero status then hehe</description>
      <pubDate>Fri, 26 Nov 2010 08:32:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782438#M28426</guid>
      <dc:creator>ratzeputz</dc:creator>
      <dc:date>2010-11-26T08:32:53Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782439#M28427</link>
      <description>I won't promise anything, but a quick look at the available documentation reveals that it probably&lt;BR /&gt;isn't all that complicated. I will have to take a closer look and find some time ...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Fri, 26 Nov 2010 13:59:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782439#M28427</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2010-11-26T13:59:05Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782440#M28428</link>
      <description>Have you thought of exposing your VB .NET SSH code via COM interfaces in a Class Library DLL?&lt;BR /&gt;You can generate a type library .TLB file from the .DLL and then use the Fortran Module Wizard on the .TLB file to generate code to call the methods. It is quite straightforward as the attached code should show. As a demonstration I built the simplest Class library Dll I could imagine, which contains a single function to return the name of the class.&lt;BR /&gt;The VB .Net code for the application (which I called ClassLibrary1) is&lt;BR /&gt;&lt;BR /&gt;Public Interface AnInterface&lt;BR /&gt; Function WhoAmI() As String&lt;BR /&gt;End Interface&lt;BR /&gt;Public Class Class1&lt;BR /&gt; Implements AnInterface&lt;BR /&gt; Public Function WhoAmI() As String Implements AnInterface.WhoAmI&lt;BR /&gt; Return "Class1"&lt;BR /&gt; End Function&lt;BR /&gt;&lt;BR /&gt;End Class&lt;BR /&gt;&lt;BR /&gt;In Visual Studio, under Application properties...assembly information.. tick the "Make assembly COM-visible" box and build the application, which creates the ClassLibrary1.DLL.&lt;BR /&gt;Then you must use the tool REGASM.EXE (normally found in one of the Framework folders in C:\windows\Microsoft.NET\) to both generate the type library .TLB file and register the TLB and add the DLL to the codebase using&lt;BR /&gt;&lt;BR /&gt;REGASM /TLB /CODEBASE ClassLibrary1.dll&lt;BR /&gt;&lt;BR /&gt;To access this class using Fortran, I created the simple console program that is attached. First though, I used the Fortran Module wizard on the ClassLibrary1.TLB file to generate the code required to handle the calls to the Class1 methods exposed to COM (the only one being WhoAmI). This generated module I called Class1Library and the code is in file Class1Library.f90. By using the CLSID and IID values given in this module, made available via the USE Class1Library statement, it is possible to create an instance of Class1 and call the 'AnInterface' method . As you should see, the code worked OK, the character string 'Class1' being returned, as desired.&lt;BR /&gt;&lt;BR /&gt;All you now have to do is create a VB .NET class containing your SSH routine(s) and expose them using 'Interface' and 'Implements' statements in the VB code. After generating the Class Library .DLL, generating the TLB and registering it, then generating a Fortran Module using the Fortran Module wizard, you should be able to call your SSH functions from Fortran by using appropriate calls to the module code.&lt;BR /&gt;&lt;BR /&gt;Hope this helps!&lt;BR /&gt;&lt;BR /&gt;P.S. I used Visual Basic 2008 Express edition to generate the class library .DLL</description>
      <pubDate>Sun, 28 Nov 2010 20:25:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782440#M28428</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2010-11-28T20:25:15Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782441#M28429</link>
      <description>I was referring to the library "libssh" that I found on the Internet - it is a (probablyhigh-level) interface&lt;BR /&gt;to the SSL protocol with some interesting components. A Fortran interface to that library should not be&lt;BR /&gt;too much work and you would get access to things like running a remote command or copying data without&lt;BR /&gt;too much fuss. (Right now though, I am missing a few auxiliary libraries that are use by libssh, so I could&lt;BR /&gt;not make progress.)&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Mon, 29 Nov 2010 07:52:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782441#M28429</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2010-11-29T07:52:30Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782442#M28430</link>
      <description>My post was aimed at the original poster.</description>
      <pubDate>Mon, 29 Nov 2010 10:02:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782442#M28430</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2010-11-29T10:02:16Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782443#M28431</link>
      <description>Sure, I understood that and I was replying to my own post ;). The sequential display hid that (mine was reply #16 to reply #14).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Arjen</description>
      <pubDate>Mon, 29 Nov 2010 10:05:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782443#M28431</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2010-11-29T10:05:10Z</dc:date>
    </item>
    <item>
      <title>using .net dll in visual fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782444#M28432</link>
      <description>Just to show that what I posted was not a fluke, I added a new Interface to access the ChilKat SFTP object after adding a reference to the &lt;A&gt;ChilkatDotNet2.dll and the ChilKat licence .DLL &lt;/A&gt;&lt;A&gt;to the VB .NET project &lt;/A&gt;&lt;A&gt;so that I could unlock the SFTP object (since I am using it for the free trial period). The new code is:&lt;BR /&gt;&lt;P&gt;Public Interface AnInterface&lt;BR /&gt; Function
WhoAmI() As String&lt;BR /&gt; Function
SendFileToSSH(ByVal a_host As String, ByVal a_port As Integer, ByVal a_user
As String, ByVal a_passWord As String, _&lt;BR /&gt; ByVal
a_path As String,
ByVal a_fileName As
String, ByVal
a_loadFromPath As String)
As String&lt;/P&gt;

&lt;P&gt;End Interface&lt;/P&gt;

&lt;P&gt;Public Class Class1&lt;BR /&gt; Implements
AnInterface&lt;BR /&gt; Public Function WhoAmI() As String Implements
AnInterface.WhoAmI&lt;BR /&gt; MsgBox("Class1
function WhoAmI entered OK")&lt;BR /&gt; Return "Class1"&lt;BR /&gt; End Function&lt;/P&gt;

&lt;P&gt; Public Function SendFileToSSH(ByVal
a_host As String,
ByVal a_port As
Integer, ByVal
a_user As String,
ByVal a_passWord As
String, _&lt;BR /&gt; ByVal a_path As
String, ByVal
a_fileName As String,
ByVal a_loadFromPath As
String) As String Implements
AnInterface.SendFileToSSH &lt;/P&gt;

&lt;P&gt; Dim
sftp As New
Chilkat.SFtp()&lt;BR /&gt; Dim
isUnlocked As Boolean&lt;BR /&gt; Dim
arguments As String&lt;BR /&gt; Dim cr As String&lt;BR /&gt; cr = Chr(10) + Chr(13)&lt;BR /&gt; arguments = "Hostname="
+ a_host + cr + "Port number=" +
Str(a_port) + cr + "User=" +
a_user + cr + "Password=" +
a_passWord&lt;BR /&gt; arguments = arguments + cr + "Path=" + a_path + cr + "Filename=" + a_fileName + cr + "Loadfrompath=" + a_loadFromPath&lt;BR /&gt; MsgBox(arguments, MsgBoxStyle.OkOnly, "Function SendFileToSSH Entered") &lt;/P&gt;

&lt;P&gt; isUnlocked = sftp.UnlockComponent("AnythingWorksFor30DayTrial")&lt;BR /&gt; ' Set some
timeouts, in milliseconds:&lt;BR /&gt; sftp.ConnectTimeoutMs = 5000&lt;BR /&gt; sftp.IdleTimeoutMs = 10000&lt;BR /&gt; If
(isUnlocked &amp;lt;&amp;gt; True) Then&lt;BR /&gt; Return
"Failed to unlock Chilkat SFtp object!"&lt;BR /&gt; Else&lt;BR /&gt; Return
"Chilkat SFtp object Unlocked OK!"&lt;BR /&gt; End If&lt;BR /&gt; End Function&lt;/P&gt;

&lt;P&gt;End Class&lt;/P&gt;&lt;P&gt;After re-building the class library DLL, reregistering it and recreating the type library file, then reprocessing the .TLB file using the Fortran Module Wizard and adding the new module to my Fortran project, could access the new interface to SendFileToSSH using the code&lt;/P&gt;&lt;P&gt;! Call the Class1 method 'SendFileToSSH'&lt;BR /&gt;a_port=22&lt;BR /&gt;a_host="somehost"&lt;BR /&gt;a_user="auser"&lt;BR /&gt;a_password="anything"&lt;BR /&gt;a_path="c:\program files"&lt;BR /&gt;a_filename="anyfile.txt"&lt;BR /&gt;a_loadfrompath="\\sstdfile1\ccl"&lt;BR /&gt;iret=$AnInterface_SendFileToSSH(iobject, a_host, a_port, a_user, a_passWord, a_path, a_fileName, &lt;BR /&gt;a_loadFromPath, retchar_SendFileToSSH)&lt;/P&gt;&lt;P&gt;	print *, "SendFileToSSH Returned character string =", TRIM(retchar_SendFileToSSH)&lt;/P&gt;&lt;P&gt;The console output, attached, showed that the call to SendFileToSSH returned OK (the diagnostic messagebox opened by SendFileToSSH had already confirmed that the function had been successfully accessed).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/A&gt;</description>
      <pubDate>Tue, 30 Nov 2010 12:55:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-net-dll-in-visual-fortran/m-p/782444#M28432</guid>
      <dc:creator>anthonyrichards</dc:creator>
      <dc:date>2010-11-30T12:55:54Z</dc:date>
    </item>
  </channel>
</rss>

