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.
I compiled the DLL and placed it in the Visual Basic main directory.VB Code:
Public Function Add_Numbers(Number1 As Integer, Number2 As Integer) As Integer Add_Numbers = Number1 + Number2 End Function
I then created another project and put this code into it
VB Code:
Private Declare Function Add_Numbers Lib "TestDll.dll" (Number1 As Integer, Number2 As Integer) As Integer Private Sub Form_Load() MsgBox Add_Numbers("7", "8") 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?




Reply With Quote