|
-
Mar 21st, 2002, 06:41 PM
#1
Thread Starter
Junior Member
Creating ActiveX DLL with Global Functions
Howdy,
I made an ActiveX DLL called myDLL. In this I had a class called myDate and a member of that class was
LastDayOfMonth(Date datSourceDate) as integer
I could see the function in the library browser (or whatever F2 is) as a global function (as well as a member of myDate)
Thus I could call it from my project as
myInteger = LastDayOfMonth( CDate("2001-12-27") )
and
myInteger = someDateObject.LastDayOfMonth...
My problem now, is that I can't seem to do it again !
ie. I'm making a DLL and I want it to have global functions which I can use without having to instantiate objects but to no avail.
Why ?????
& Also, is there an equivalent of "static" which I can use, ie to call a member method using the class rather than an object?
Thanks in advance
Damian Del Campo
-
Mar 21st, 2002, 08:05 PM
#2
Change the instantancing of the class to 'Global Multiuse'
-
Mar 21st, 2002, 08:11 PM
#3
Thread Starter
Junior Member
That worked a treat and ended hours and hours of hair pulling.
Thanks a million,
Damian Del Campo
BTW I pressume "collections" are the equivalent of using static members. ie call a member function not globally but within a certain namespace without needing an object. If this is incorrect, can you let me know.
-
Mar 21st, 2002, 09:50 PM
#4
Collections are closer to arrays of objects. There is the Collection object which also you to add objects and things to it and associate a key with that, also you can add and remove items from it with very little code. Or in the case of working with classes you can make a collection class that is basically a multiply version of a single class. I'm sorry that is not the best explanation but if you run a quick search you should see some examples to better explain.
-
Mar 21st, 2002, 11:17 PM
#5
Thread Starter
Junior Member
Well then, does VB have any equivalent of a C++ static function ?
Damian Del Campo
-
Mar 21st, 2002, 11:29 PM
#6
I don't know, I don't know enought about C++. What is a static function?
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
|