Results 1 to 13 of 13

Thread: [Partly Resolved] DLL Problem...

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    [Partly Resolved] DLL Problem...

    I want to create a DLL that any program can access.
    I've had a look through the search and i've only found a few answers to my question...

    First of all i found out that it needs to be an ActiveX DLL Project.

    So i created one and put the following code into it.

    VB Code:
    1. Public Function Add_Numbers(Number1 As Integer, Number2 As Integer) As Integer
    2.  
    3. Add_Numbers = Number1 + Number2
    4.  
    5. End Function
    I compiled the DLL and placed it in the Visual Basic main directory.

    I then created another project and put this code into it

    VB Code:
    1. Private Declare Function Add_Numbers Lib "TestDll.dll" (Number1 As Integer, Number2 As Integer) As Integer
    2.  
    3. Private Sub Form_Load()
    4.  
    5. MsgBox Add_Numbers("7", "8")
    6.  
    7. End Sub

    When i start the project it comes up with the following error

    "Can't find DLL entry point Add_Numbers in TestDll.dll"

    From what i can tell, it can't find the function that i placed into the dll.

    I need to know what i'm doing wrong, wether i've created the dll the wrong way (so that the function is not in some way accessable outside the dll) or if i'm calling it incorrectly.

    I've had a few goes at acreating ActiveX ocx files and i know that all the functions methods, properties, subs etc i wanted other programs to have access to i had to tell visual basic manually (i used a wizard when creating).

    Can some one tell me what's going on, or point me in the right direction, without referecing... or is that impossible?
    Last edited by Slyke; Jun 11th, 2006 at 03:45 PM.

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