Problem VBA & DLL files

Discussion in 'AutoCAD' started by BILL, Aug 14, 2003.

  1. BILL

    BILL Guest

    Hi to all.
    i have the following problem when i try to call a dll file from VBA as shown
    below
    ------------------
    Private Declare Sub SimpleTest Lib "c:\SimpleTest\SimpleTest.dll" (x As
    Variant, y As Variant)
    Public Sub Test()
    Dim x As Variant
    Dim y As Variant
    Call SimpleTest(x, y)
    End Sub
    -------------

    i get the following error
    ---------------
    Run-time error '453'
    Can't find DLL entry point SimpleTest in c:\SimpleTest\SimpleTest.dll
    ----------------

    the dll file is a test dll file that i create in Digital visual fortran
    6.0.A (below is the Fortran code that i used in order to build the DLL file)
    ---------------------
    program SimpleTest
    real x
    real y
    x=3
    y=2+x
    end program SimpleTest
    -----------------------

    I am Trying to call dll files(fortran files converted to dll) from VBA. But
    with no luck at all. Finally i tried to make the above connection but
    nothing!
    Please help me!!!
    Thanks a lot!!!
     
    BILL, Aug 14, 2003
    #1
  2. Did you export the function?
     
    Frank Oquendo, Aug 14, 2003
    #2
  3. BILL

    BILL Guest

    As you have understand i haven't done anything like this again, so could you
    be more specific?
    Thanks again
    Bill
     
    BILL, Aug 18, 2003
    #3
  4. I don't know how to do it in Fortran but in C++ there's a .DEF file
    which contains an EXPORTS section. This section declares all publicly
    accessible entry points into the DLL.

    In addition, exported functions also include the WINAPI macro as part of
    their signature.
     
    Frank Oquendo, Aug 18, 2003
    #4
  5. Oops. Or the STDAPI macro.
     
    Frank Oquendo, Aug 18, 2003
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.