|
-
Nov 20th, 2000, 11:19 AM
#1
Thread Starter
Lively Member
i think traditional usage of DLLs is to contain a library of subs and fuctions.
I've developed a class that I'd like to reuse in projects in the future but I don't want the class code in the project to prevent any temptation to altering it (and maybe breaking my other applications).
Can I compile just a class into a .DLL and then create an instance of that class in my project?
ive looked around and haven't found anything like this.
thanks for any info anyone can provide
-
Nov 20th, 2000, 11:22 AM
#2
Yes, you can compile just a class into an ActiveX Dll.
Paul
-
Nov 20th, 2000, 11:30 AM
#3
Well ...
You didn't find anything, because in VB, that's what DLLs are meant for, writing classes.
In VB, you cannot write a DLL without having a class into it, so it's not simply a collection of Subs and Functions.
-
Nov 20th, 2000, 11:37 AM
#4
Thread Starter
Lively Member
ahh =)
thanks for the info..
is any special notation required when instancing a class that resides in a .DLL instead of a class that resides in the project?
thanks again
-
Nov 20th, 2000, 11:47 AM
#5
You can either make a reference to the dll and use your class just like you would when referencing any other dll (like when you reference ADO to make connections and recordsets) or use CreateObject. I prefer to make a reference to get the Intellisense support.
Cheers,
Paul
-
Nov 20th, 2000, 11:48 AM
#6
Well ...
Nope, only in case of DLL, add a reference to it through Project > References.
-
Nov 20th, 2000, 12:10 PM
#7
Thread Starter
Lively Member
last question ;)
you guys have been a big help, thanks
ive created my class. it has public properties and subs defined, i compile into the DLL and set a reference to it in another project. after i create an instance of my new object i'm not getting any intellisense support.
something doesn't seem right. Do i have to use regsvr32 with my .DLLs before i can use them?
thanks =)
-
Nov 20th, 2000, 12:16 PM
#8
You shouldn't have to. How are you instancing your object? After making a reference you should be able to do something like:
Dim obj As YourClassName
Set obj = New YourClassName
obj.WhatEver ' You should get intellisense support here!
Set obj = Nothing
Paul
-
Nov 20th, 2000, 12:18 PM
#9
Thread Starter
Lively Member
not sure what happened but ive got intellisense now.. thanks anyway =)
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
|