- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Everyone,
I can't make the following code working in VS2015 with IVF, though it is very simple. Value C from dll is always 0, not 6.0 as expected. Thanks so much.
//my VB code:
Public Class Form1
Public Declare Sub DLL_ROUT Lib "D:\Debug\Dll2.dll" _
(ByVal A As Double, ByVal B As Double, ByVal C As Double)
Public Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim A As Double
Dim B As Double
Dim C As Double
A = 2.0
B = 3.0
Call DLL_ROUT(A, B, C)
Button1.Text = C
End Sub
End Class
// my Fortran dll code:
SUBROUTINE DLL_ROUT (A, B, C)
IMPLICIT NONE
! Specify that DLL_ROUT is exported to a DLL
! and that the external name is 'DLL_ROUT'
!DEC$ ATTRIBUTES DLLEXPORT, STDCALL :: DLL_ROUT
!DEC$ ATTRIBUTES ALIAS:'DLL_ROUT' :: DLL_ROUT
DOUBLE PRECISION A, B, C
C = A * B
RETURN
END
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This looks more like a problem for the Windows Forum, and not for the Linux/MACOSX Forum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry, wrong forum
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page