how to create a DLL
-
i created a DLL with some functions that i'd use in a VB or someother application, but the problem is for every exported function , i need to do like [code] Private Declare Function MyTestFun1 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer Private Declare Function MyTestFun2 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer [/code] what i need is like, when u create an object using Microsoft scripting runtime, you'll get access to FileSystemObject. (fso) so in VB, you do like [code] Dim fso as new fileSystemObject later on you'd use all functions by fso.(dot).. [/code] how'd i do my own dll like MSScripting runtime..?:( regards, Rookie -- modified at 4:37 Thursday 22nd September, 2005
-
i created a DLL with some functions that i'd use in a VB or someother application, but the problem is for every exported function , i need to do like [code] Private Declare Function MyTestFun1 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer Private Declare Function MyTestFun2 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer [/code] what i need is like, when u create an object using Microsoft scripting runtime, you'll get access to FileSystemObject. (fso) so in VB, you do like [code] Dim fso as new fileSystemObject later on you'd use all functions by fso.(dot).. [/code] how'd i do my own dll like MSScripting runtime..?:( regards, Rookie -- modified at 4:37 Thursday 22nd September, 2005
-
i created a DLL with some functions that i'd use in a VB or someother application, but the problem is for every exported function , i need to do like [code] Private Declare Function MyTestFun1 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer Private Declare Function MyTestFun2 Lib "MDLL.dll" (ByVal hWnd As Long, ByVal a As Integer, b As Integer) As Integer [/code] what i need is like, when u create an object using Microsoft scripting runtime, you'll get access to FileSystemObject. (fso) so in VB, you do like [code] Dim fso as new fileSystemObject later on you'd use all functions by fso.(dot).. [/code] how'd i do my own dll like MSScripting runtime..?:( regards, Rookie -- modified at 4:37 Thursday 22nd September, 2005
There are two things you need to do: First define your functions in the DLL so VB can call them correctly: // DLL external entry points for VB long WINAPI MyTestFun1(HWND hwnd, int a, int b) long WINAPI MyTestFun2(HWND hwnd, int a, int b) // Then you will need a def file for the DLL so the entries are public and VB can pull them out LIBRARY MDLL DESCRIPTION 'Test DLL' EXETYPE WINDOWS EXPORTS MyTestFun1 @1 MyTestFun2 @2 Your VB defines look correct so it should work with these changes.