CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: dll entry point

  1. #1
    Join Date
    Oct 1998
    Posts
    1

    dll entry point



    Hi,


    I am trying to access a DLL writen in Fortran. Unfortunately, whenever the VB module attempts to communicate with the DLL I get run-timr error 453 and this message 'cannot find the DLL entry point'


    The code for the VB and Fortran modules are listed below. I will appreciate your help.


    Riak


    Option Explicit

    Private Type StringArray

    strings As String * 24

    End Type

    Private Declare Sub FORSTRARR Lib "E:VB\fortVB.dll" (Myarray As

    StringArray)


    Private Sub Command1_Click()

    Dim I As Integer

    Static arr(1 To 5) As StringArray

    Call FORSTRARR(arr(1))

    For I% = 1 To 5

    text1.Text = arr(I%).strings + Chr$(13) + Chr$(10) + text1.Text

    Next I%

    End Sub


    The fortran DLL contains the following code


    SUBROUTINE forstrarr(arr)

    CHARACTER(24) arr(5)

    arr = "This is a string from Fortran."

    END SUBROUTINE




  2. #2
    Join Date
    Oct 1998
    Posts
    1

    Re: dll entry point



    the one thing i know that may be relevant is that to call a function in a dll from vb the function must use the pascal calling convention. i don't know fortran, but if it doesn't use pcc then it won't work.

  3. #3
    Join Date
    Dec 1998
    Posts
    28

    Re: dll entry point



    When you make a dll in any other language buy VB, you have to do something in the code to make it export the function someohow... in C/C++ you would add a few lines to the header file and prefix EXPORT infront of your function name. I dont know fortran so I couldn't tell you how to do it in that language.

  4. #4
    Join Date
    Dec 1999
    Location
    Basically India, But now At Oman
    Posts
    1

    Re: dll entry point

    Hi,
    I too face the same probs when i try to access a VB DLL from an VB EXE Being a VC++ programmer i can understand that the function in a DLL has to be exported and i being a VB learner i don't know how to export a function from a VB DLL so that i can access that from VB EXE File.
    Any help will be of Very much Use to Me.
    Being a Newbie to this site i would like to sent a copy to [email protected].
    Thanks.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured