- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Everyone,
I just started using VS2010 with IVF, I am trying to build a very simple DLL as below and call it from VB (in VS2010). It builds OK, I don't get any error, the problem is that nothing happend when I pass the call to IVF DLL, I expect a to change from 2 to 5, but it stays 2. the other question is how can I debug IVF DLL part. I was used work with VB6, CVF and there I just introduced VB .exe file as an external file for CVF in order to debug DLL part.
Thanks
************* IVF Part ************
subroutine Dll1(a)
implicit none
!DEC$ ATTRIBUTES DLLEXPORT, STDCALL :: Dll1
!DEC$ ATTRIBUTES ALIAS:'Dll1' :: Dll1
Doubleprecision :: a
a=5.0;
return
end !subroutine Dll1
************* VB Part **************
Public Class Form1
'Declare Sub Dll1 Lib "C:\\VSPractices\\WindowsApplication1\\Dll1\\Debug\\Dll1.dll" (ByVal a As Single)
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Double
a = 2
Call Dll1(a)
End Sub
End Class
Module Module1
Public Declare Auto Sub Dll1 Lib "C:\\VSPractices\\WindowsApplication1\\Dll1\\Debug\\Dll1.dll" _
(ByVal a As Double)
End Module
I just started using VS2010 with IVF, I am trying to build a very simple DLL as below and call it from VB (in VS2010). It builds OK, I don't get any error, the problem is that nothing happend when I pass the call to IVF DLL, I expect a to change from 2 to 5, but it stays 2. the other question is how can I debug IVF DLL part. I was used work with VB6, CVF and there I just introduced VB .exe file as an external file for CVF in order to debug DLL part.
Thanks
************* IVF Part ************
subroutine Dll1(a)
implicit none
!DEC$ ATTRIBUTES DLLEXPORT, STDCALL :: Dll1
!DEC$ ATTRIBUTES ALIAS:'Dll1' :: Dll1
Doubleprecision :: a
a=5.0;
return
end !subroutine Dll1
************* VB Part **************
Public Class Form1
'Declare Sub Dll1 Lib "C:\\VSPractices\\WindowsApplication1\\Dll1\\Debug\\Dll1.dll" (ByVal a As Single)
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim a As Double
a = 2
Call Dll1(a)
End Sub
End Class
Module Module1
Public Declare Auto Sub Dll1 Lib "C:\\VSPractices\\WindowsApplication1\\Dll1\\Debug\\Dll1.dll" _
(ByVal a As Double)
End Module
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It simply due to the fact that the argument is passed by value instead of reference (Byref). In the fortran code you need to change the line:
[fortran]!DEC$ ATTRIBUTES DLLEXPORT, STDCALL :: Dll1[/fortran]by
[fortran]!DEC$ ATTRIBUTES DLLEXPORT, STDCALL, REFERENCE :: Dll1[/fortran]and the VB declaration:
[vb]Public Declare Auto Sub Dll1 Lib "C:VSPracticesWindowsApplication1Dll1DebugDll1.dll" _ (ByVal a As Double)[/vb]by
[vb]Public Declare Auto Sub Dll1 Lib "C:VSPracticesWindowsApplication1Dll1DebugDll1.dll" _ (ByRef a As Double)[/vb]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, the problem was resolved. I am also trying to debug from IVF DLL, when I put a breakpoint there it does not go in and a yellow exclamation mark appears that says "the breakpoint will not currently be hit. no symbols have been loaded for this document". do you have any clue how to get into the IVF DLL part in debug mode?
Regards
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to use the Debug configuration for the Fortran Dll and you need to start debugging from the Fortran project (you have to configure the main program to run when debugging in the fortran project properties window : "Debugging" section and on the right side just fill the "Command" field, you can also define here the "Working directory").
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help, It worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does IVF have auto-complete feature? is there any add-ons that does that?
Thanks
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No it does not.

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