Results 1 to 6 of 6

Thread: Creating ActiveX DLL with Global Functions

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2001
    Location
    Adelaide, Australia
    Posts
    24

    Angry 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

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Change the instantancing of the class to 'Global Multiuse'

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2001
    Location
    Adelaide, Australia
    Posts
    24
    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.

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Feb 2001
    Location
    Adelaide, Australia
    Posts
    24
    Well then, does VB have any equivalent of a C++ static function ?

    Damian Del Campo

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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
  •  



Click Here to Expand Forum to Full Width