Click to See Complete Forum and Search --> : Running an ActiveX Dll
MuzzaD
Mar 15th, 2002, 01:16 AM
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.
Edneeis
Mar 15th, 2002, 02:40 AM
You want the long anser or the short answer?
The short answer: no.
The long anser: still no.
Edneeis
Mar 15th, 2002, 12:28 PM
Out of curiosity why do you want to use them the same?
MuzzaD
Mar 15th, 2002, 01:37 PM
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).
Edneeis
Mar 15th, 2002, 02:14 PM
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.
MuzzaD
Mar 15th, 2002, 04:48 PM
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"
Edneeis
Mar 15th, 2002, 05:16 PM
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):
dim obj as New MyClass
obj.Text="My Text"
obj.Transfer
MuzzaD
Mar 15th, 2002, 05:20 PM
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.
Edneeis
Mar 15th, 2002, 07:00 PM
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.
dim obj as object
set obj=CreateObject("Project1.MyClass")
obj.Text="My Text"
obj.Transfer
set obj=nothing
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.