Results 1 to 5 of 5

Thread: Dll call problem

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274

    Post

    I made an ActiveX DLL and I registered. I want to call the functions into it in the same way that I call the API functions, for example functions into a USER32.DLL. But if I declare and call the function that is into my DLL I receive this error message:

    Can't find DLL entry point Test in Proyect1

    'Test' is the function tha I made into 'Proyect1.DLL'

    The code of my ActiveX DLL is:
    Code:
    Public Function Test(x As Integer, y As Single) As Integer
       MsgBox x & " - " & y
       Test = 7365
    End Function
    And the code of the EXE proyect from I want to call the Test function is:

    Code:
    Option Explicit
    
    Private Declare Function Test Lib "proyect1" (ByRef x As Integer, ByRef y As Single) As Integer
    
    Private Sub Form_Load()
        Dim s As Integer
        s = Test(3, 13.5)
        MsgBox "The returned value is: " & s
    End Sub
    Any idea will be deeply appreciated!

    Thanks


    [This message has been edited by Tonatiuh (edited 01-06-2000).]

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    You are making COM dlls, not traditional C++ dlls.

    To use, you need to add a reference to your ActiveX dll via the PROJECT --> REFERENCES and instantiate the object in code:

    Code:
    'declare variables, etc.
    Dim objMyClass as MyDLL.MyClass
    dim varReturnValue as variant
    
    
    'instantiate instance of class
    set objMyClass = new MyDLL.MyClass
    
    
    'invoke function in class
    varReturnValue = objMyClass.DoSomething(<Param1>, <param2> )
    
    
    'all done for now, destroy object
    set objMyClass = Nothing
    HTH

    Tom

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274

    Post

    Yes Tom but, Is there any way to make a DLL and call its functions in the same way as an API function using VB?

    [This message has been edited by Tonatiuh (edited 01-06-2000).]

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    A clue I have not!

    Speculation:
    'Cant find DLL entry point' means that the library is not loaded into memory. Maybe you can call another API to load the library into memory, then call one of its functions.

    Anyone else?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274

    Post

    How can I implement and AddressOf functionallity into my DLL.

    I want to return a list to the application.

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