|
-
Sep 27th, 2000, 03:43 AM
#1
Thread Starter
Member
I have several resuable functions and subroutines that i want to encapsulate into a dll. The problem is, I don't know how. What i'm doing today is that I put them in several standard modules and add that modules to my project.
I know that this is a very simple question but believe me, I really don't know how to do it.
I tried to put all of them into a ActiveX dll project but I don't have a class in it and so VB did not allow me to create the project.
Mikey
A/P
Using VB6 SP4 Enterprise Ed.
-
Sep 27th, 2000, 03:52 AM
#2
Addicted Member
Hi,
Start up VB and select ActiveX DLL as your project. Then copy your code from your modules(.bas) and paste it into a class module in your new project. (You can add more class modules to the project by right-clicking in the project explorer and going Add>Class Module).
You can then compile this into a DLL and reference it in the normal way to use it's methods,propereties and events.
Hope this helps
Shaun
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
-
Sep 27th, 2000, 04:03 AM
#3
Addicted Member
When you are realy smart you take a look at http://www.vbsquare.com and look for the articels named "Beginning object in VB". I used them and I have now created my first DLL used for multiple functions my collegue wanted to use. It had to be a DLL becouse he only wants to program in VBA and VB.
I wish you good luck. I know you can do it. After all I could.
Catch you later,
Jeroen Hoekemeijer
Code:
If 1 = 2 Then MajorError
-
Sep 27th, 2000, 04:27 AM
#4
Thread Starter
Member
Thanks! I started doing the advice of S@NSIS. It works but since its a class, i have to create an instance of the class and then expose the objects methods, properties, etc.. Now, I want to use the methods in my library as if i'm calling a VB function. Just like this:
msgbox "Hello" 'vb function
messagebox "Hello" ' a function called from my library
I'm now checking out vbsquare's beginning objects series. Thanks guys!
Mikey
A/P
Using VB6 SP4 Enterprise Ed.
-
Sep 27th, 2000, 08:20 AM
#5
Frenzied Member
Try this:
create a DLL project with a class in it
set the class Instancing property to GlobalMultiUse or GlobalSingleUse (if you do a Help on the Instancing property you'll find which one is better, I can't remember off the top of my head and I'm too lazy to open VB)
make all your functions, variables, Types, etc members of the class
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
|