I need to be able to create an object in my vb executable and then reference the same object in another program several times. Thanks.
-Incredulous
Printable View
I need to be able to create an object in my vb executable and then reference the same object in another program several times. Thanks.
-Incredulous
You would have to make either of your application ActiveX EXE then
And then just reference it in the other program like a activex dll? What's the syntax for this? Thanks much.
-Incredulous
yeah, you should have both classes in both projects, i'm not sure but you could refer to the activeX by using it's project name
Well, I've got it to work in another vb executable by using createobject. I also need it to work in vbscript. When I tried to call one of my exe functions, I get an error of type mismatch that doesn't show up in the vb executable. Any ideas? Thanks.
-Incredulous
[Edited by Incredulous on 08-07-2000 at 03:33 PM]
hmm, maybe you had the wrong type declarations, check for what youre passing and what is needed, otherways i can't help since you haven't shown any code
Here is my code for vbscript (note, i'm using a program to run this that uses vbscript)
--------------------------------------------------------
Option Explicit
Dim WSTLibObject, _
Utility, _
Logger, _
Test
Set WSTLibObject = CreateObject("AQTEXE.WSTLibObject")
Set Utility = CreateObject("WSTLib.Logger")
Test = WSTLibObject.SaveUtilityObject(Utility)
If Not Test Then
MsgBox "bad"
End If
Set Utility = Nothing
--------------------------------------------------------
Here the code from my activex exe.
--------------------------------------------------------
the bas module file:
Option Explicit
Public GlobalUtility As Object
Public GlobalLogger As Object
the class mod:
Public Function SaveUtilityObject(Utility As Object) As Boolean
SaveUtilityObject = False
On Error GoTo ErrorHandler
Set GlobalUtility = Utility
SaveUtilityObject = True
Exit Function
ErrorHandler:
End Function
Public Function GetUtilityObject() As Object
Set GetUtilityObject = Nothing
On Error GoTo ErrorHandler
Set GetUtilityObject = GlobalUtility
Exit Function
ErrorHandler:
Set GetUtilityObject = Nothing
End Function
--------------------------------------------------------
The set object on my log dll is fine. The line it dies at is:
Test = WSTLibObject.SaveUtilityObject(Utility)
If I remove the Test =, it works fine. I'm sure this is something really simple, but it could be the program I'm using that runs vbscript. Many thanks to kedaman.
-Incredulous