|
-
Feb 8th, 2011, 09:13 AM
#1
Thread Starter
Fanatic Member
Sample dll
Hi
Someboy have a example dll very very simple, that show only a msgbox
Using VB6
Tia
When I tried to execute show me error
Code:
Can't find DLL entry point timao in C:\TesteSap.dll
Last edited by mutley; Feb 8th, 2011 at 09:41 AM.
-
Feb 8th, 2011, 10:00 AM
#2
Re: Sample dll
VB6 does not create DLLs you declare as an API. It creates ActiveX DLLs, similar to ADO, DAO, FSO references you may have used. This means that you build your DLL then add it as a reference, not Declare it. Then in code, you create an instance of your dll's exposed class and call its functions/subs.
So, for your example
1. Create a new DLL project
2. Make the class' Instancing property MultiUse if not already done.
3. Give the class a more meaningful name besides Class1
4. Add a public routine in that class the simply shows a message box
5. Now create a new project and reference that dll project (or compile the DLL and reference it directly)
6. Behind a button, Dim a variable as your DLL's class name. Set it to a New instance. Call its function
-
Feb 8th, 2011, 10:05 AM
#3
Re: Sample dll
Also... to save you a lot of time and effort and heartache... in my sig is a link regarding Binary Compatibility ... I suggest reading it before you go too far and working with it... as you make changes to your DLL, even if it is a test one, it will make life a whole lot easier.
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|