Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB using DLL error

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi there,

I have a VB program which makes use of DLL. And i encounter the error "Can't find DLL entry point". Does anyone know how to solve this problem.

Thanx :)
 
You need to know the structure of the DLL you are calling.
C++
If it is a C++ API DLL, then it will have either named entry points like SendMessage:
Code:
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long
Or numeric entry points, like the following hidden function in Shell32.DLL to shoe the find files dialog:
Code:
Declare Function SHFindFiles Lib "Shell32" Alias "#90" (ByVal pidlRoot As Long, ByVal pidlSavedSearchas As Long) As Boolean
You will need to find out the exact numeric entry point if named entry points do not exist.

ActiveX
If the DLL is an ActiveX DLL (built in VB?) then create a reference to it in the VB references menu. Then it class can be created as such:
Code:
'// Declare as follows
Dim objDLLClass As New myDLLClass

'// Call as follows
Call objDLLClass.myDLLFunction(myParam)
alternatively you can use the CreateObject method if no application refernce is required:
Code:
'// Declare as follows
Dim objDLLClass As Object
Set objDLLClass = CreateObject("myDLLname.myDLLClass")

'// Call as follows
Call objDLLClass.myDLLFunction(myParam)
Look in the MSDN for more details.

I hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top