Results 1 to 6 of 6

Thread: Functions in ActiveX DLL

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    39

    Functions in ActiveX DLL

    I am writing an ActiveX DLL that only has functions that I am exposing to other programs. There is no classes, methods, properties, just public functions.
    I make sure that programs reference that dll file in References. However; it seems like progs don't see those functions, when I run them. Is there something that I am missing?

    Thanks.

  2. #2
    Voldemort
    Guest

    Smile

    If you read the threads titled "Where have all the DLL's gone" the answer that Reeset gave will solve your problem. Basically I was trying to do the same as you but because you automatically set up a class when you use an Active X DLL you have to use the function as an object and create an instance of it before you can access the functionality.

    I found that with simple parameter passing the Active X DLL approach works OK but be careful when you try and send blocks of data into and out of your functions using "Types". Problems can arise when you include strings in the types.

    On a final note an Active X DLL apears different to that of an ordinary DLL. Unless users are able to specifically read the Active X type of file they may not be able to get at your functions.

    It apears that unlike more common DLL structures Active X has a pointer to a list of classes (ie your functions) presumably at this pointer location there is a further breakdown of the class itemising your properties and methods. The more common DLL structure (C++) has a direct list showing where each method (function or procedue) lies within the DLL. For these you can access the data using the Declare syntax.

    It's a shame VB doesn't give you the option of both aproaches - does anyone out there know if standard (non Active X) DLL's can be generated using VB?


  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    you can also just change the class 'Instancing' prop to 'Global MultiUse' and then you don't have to make an object or anything. You can call the functions the same as you would if they were in a standard module.
    Of course your functions have to be part of the class module in the dll not in a standard module inside the dll.

  4. #4
    Voldemort
    Guest
    Thanks for that Edneeis.

    While it does make it easier to access the Function and Sub calls in the VB environment, the routines are still invisible when you try to access them using a Declare statement.

    Because of this problems can occur when you try to port out VB DLL's to other non VB or non active X compatible users.

    Such a simple issue it's a shame that Microsoft do not include standard DLL generation in VB.


    ---------------------------------------
    Lets build some bridges Mr Gates


  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    39
    Thanks a lot Voldemort,

    It looks like I will have to learn VC++ just to write a simple DLL. I have a class module that deals with strings and registry functions, so there are some Types that will be passed to functions. Unfotunatelly, it seems like I am going to have to stick with class modules.

    Thanks for all your suggestions.

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    you could wrap the type in a class and do some funky stuff to kinda get around it. here is a sample.

    I actually had this big long thing to say but my IE freaked when I went to post it @#$%.

    Then after taking a second look this probably wont help you one bit, but now I already put energy into so I have to post it now.

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