Results 1 to 9 of 9

Thread: Running an ActiveX Dll

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Location
    Land of the long white cloud
    Posts
    86

    Arrow Running an ActiveX Dll

    Is it possible to run an ActiveX Dll created with VB in the same way you would run a windows API DLL?

    All attempts so far have failed due to the lack of an entry point.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You want the long anser or the short answer?

    The short answer: no.

    The long anser: still no.

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Out of curiosity why do you want to use them the same?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Location
    Land of the long white cloud
    Posts
    86
    I need to write a DLL for a program that will be accessible from a number of other different programs. But I only have the necessary library files for my main program in VB. Hence, if the DLL has to be written in C the libraries will need to be rewritten (a major task considering the number involved).

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Well an ActiveX DLL is COM based so any language that can use COM Objects should be able to use your ActiveX DLL. Or maybe I missed something.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Location
    Land of the long white cloud
    Posts
    86
    I hear what you are saying, however one of the programs that need to access the DLL has been written in VB and it is this program that keeps getting the error "Cant find Entry Point"

  7. #7
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    With ActiveX DLLs yo don't declare the individual functions like you do with standard/other dlls. You declare an object of one of the classes from the dll.

    Say you have a MyClass class in your activeX dll and it has a Text property and a Transfer method. Then this is an example of how you would use it in VB (after you make a reference to it in your program):
    VB Code:
    1. dim obj as New MyClass
    2.  
    3. obj.Text="My Text"
    4. obj.Transfer

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Mar 2002
    Location
    Land of the long white cloud
    Posts
    86
    Your right, I will have to make it a reference within the other programs, something I was trying to avoid.

    Thanks for your help, it has been nice to be able to bounce this topic around and clear my thinking.

  9. #9
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Well you can take a bit of a performance hit and use latebinding if you don't want to make a reference. That will require the Projectname also.

    VB Code:
    1. dim obj as object
    2. set obj=CreateObject("Project1.MyClass")
    3.  
    4. obj.Text="My Text"
    5. obj.Transfer
    6.  
    7. set obj=nothing

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