- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would like to find out if there is a way to create fortran dll that in turn will be called by VB 6.0. So far i have tried multiple different ways to accomplish this but it seems that i can not create a dll that will work just right. When the dll is called by Visual Basic 6.0 the following error message is displayed:
"Run Time Error 453"
Can't find DLL entry point _xadd@8 in .....
The fortran dll has one subroutine called xadd, which takes two parameters, both single in VB or real*4 in fortran and it outputs their result. I read numerous articles on this topic but had no luck so far. What am i doing wrong? Any ideas, comments or suggestions would be appreciated, thanks.
"Run Time Error 453"
Can't find DLL entry point _xadd@8 in .....
The fortran dll has one subroutine called xadd, which takes two parameters, both single in VB or real*4 in fortran and it outputs their result. I read numerous articles on this topic but had no luck so far. What am i doing wrong? Any ideas, comments or suggestions would be appreciated, thanks.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Both linker and run-time binding are case-sensitive. By default, CVF uppercases names in exported symbols and .objs, while VB expects lowercase. So, you can fix it either by aliasing the export on CVF side:
!DEC$ATTRIBUTES DLLEXPORT, DECORATE, ALIAS: "xadd":: XAdd
or
!DEC$ATTRIBUTES DLLEXPORT, ALIAS: "_xadd@8":: XAdd
(on older CVF versions)
or import on VB side:
Declare Sub XAdd(...) Lib "MyDll.dll" Alias "_XADD@8"
DUMPBIN command-line tool which comes with CVF can tell you a lot about contents of libs, objs and dlls.
Jugoslav
!DEC$ATTRIBUTES DLLEXPORT, DECORATE, ALIAS: "xadd":: XAdd
or
!DEC$ATTRIBUTES DLLEXPORT, ALIAS: "_xadd@8":: XAdd
(on older CVF versions)
or import on VB side:
Declare Sub XAdd(...) Lib "MyDll.dll" Alias "_XADD@8"
DUMPBIN command-line tool which comes with CVF can tell you a lot about contents of libs, objs and dlls.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the pointer. At this time let me show you what code i have:
In fortran i wrote the following function which i turned to xadd.dll:
function xadd(a,b)
!DEC$ATTRIBUTES DLLEXPORT,ALIAS: "_xadd@8":: Xadd
xadd=a+b
return
end
In my VB 6.0 module global for the test project i wrote the following:
Public Declare Function xadd Lib "c:dllsxadd.dll" Alias "_xadd@8" (ByRef a As Single, ByRef b As Single) As Single
I do not know what to do beyond this point. I do not get any more errors, but my value from the xadd.dll is not being passed to VB. Any ideas or am i doing anything wrong again, thanks
In fortran i wrote the following function which i turned to xadd.dll:
function xadd(a,b)
!DEC$ATTRIBUTES DLLEXPORT,ALIAS: "_xadd@8":: Xadd
xadd=a+b
return
end
In my VB 6.0 module global for the test project i wrote the following:
Public Declare Function xadd Lib "c:dllsxadd.dll" Alias "_xadd@8" (ByRef a As Single, ByRef b As Single) As Single
I do not know what to do beyond this point. I do not get any more errors, but my value from the xadd.dll is not being passed to VB. Any ideas or am i doing anything wrong again, thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks i got it

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