[RESOLVED] ActiveX DLL- Include common Subs/Functions that should not need Object Instantiation
Hey all,
What I'm trying to do is store some common Subs/Functions (that I would put in a Module) inside of an ActiveX DLL so that I can reuse the code for all of my applications.
I was hoping not to do Object instantiation because some of the Functions return Objects (and act like Constructors). Also I have some other functions/subs that should not require instantiation as they only work with the arguments passed on to them.
Anyways, I was trying to include a Module in the DLL I'm working on, yet it doesn't have scope outside of the DLL. That is... my applications cannot call the functions inside it.
I'm not exactly sure that making an ActiveX DLL is the correct route I want to go.
Ultimately, I'm trying to call a Function/Sub as if it was included in the application's project that I intend to use it in... Except, I don't want to re-type it into every application that needs the use the Function/Sub.
Your help is greatly appreciated! :)
God Bless,
-Nick
Re: ActiveX DLL- Include common Subs/Functions that should not need Object Instantiat
I found another thread with the same issue:
http://www.vbforums.com/showthread.p...nother-project
It seems these Functions/Subs will indeed need to be in an Object that is instantiated.
So, I believe the most elegant way of doing this is to create a Class Module that store all these common Functions/Subs, then instantiate it once as a global variable in my projects.
Please let me know if you find anything to the contrary. I'd realy like to achieve the originally mentioned functionality.
EDIT: I was able to do the desired by creating a Module and Class Module with the same functions. The Module so that the Functions can be used by other Classes in the DLL. The Class Module so that the Functions are visible outside of the DLL (instancing = GlobalMultiUse).
Still looking for a better solution as it seems pointless to have both a Module and Class Module with duplicate contents.
Re: ActiveX DLL- Include common Subs/Functions that should not need Object Instantiat
Re: ActiveX DLL- Include common Subs/Functions that should not need Object Instantiat
Hey Bonnie,
Thanks for the reply.
Unfortunately, I've came across that article before and I wasn't successful in creating a DLL that I could load back into my VB6 Projects.
It does seem like it should work though...
Do you know if what is on that page can still be done? Or if they are any peculiarities I should be aware of?
Thanks much!
Re: ActiveX DLL- Include common Subs/Functions that should not need Object Instantiat
I haven't tried creating a DLL myself using the instructions there. But, based on the comments there, I suppose the author's method works. Did you follow the DLL example closely or did you deviate somehow?
Re: ActiveX DLL- Include common Subs/Functions that should not need Object Instantiat
Huzzah! Success!
I cannot believe it works! :)
Only down side is that I neeed to remember use the proxy link.exe file in order to VB6 to have Windows DLL Compatibility.
Aside from that, the article does indeed work (although it sometimes is quite unclear).
Thanks much for the help Bonnie!
God Bless,
-Nick