Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to creat dll file and use dll for in VB 6.0?

Status
Not open for further replies.

bidondon

New member
Dec 9, 2005
1
Hi!
I'm a fortran beginner. Now i'm using DVF 6. And I want to creat a user interface for my for. program by VB6. I have done an example from several references, but It doesn't work.
First, I created a Fortran project as dll project type.
My fortran code is below:
======================
subroutine pro1( a, b, c )

!DEC$ ATTRIBUTES DLLEXPORT :: pro1
!DEC$ ATTRIBUTES ALIAS : 'pro1' :: pro1

integer a,b,c
c=a+b

end subroutine
==========================
Then, I run fortran and a pro1.dll file was created.
after that, I created a vb project. I copied also the dll file into the same directory with the vb project.
code vb:
Private Declare Sub pro1 Lib "pro1.dll" _
(a As interger, b as integer, c As integer)

Private Sub cmdbut_Click()

Dim c As integer

call pro1(3,4,c)
txt1.text=cstr(c)
End Sub
=================
When i run vb program, there was a error: "can not find the entry point pro1 dll".
Could you help me?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor