|
-
Aug 7th, 2000, 01:27 PM
#1
Thread Starter
New Member
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
-
Aug 7th, 2000, 01:36 PM
#2
transcendental analytic
You would have to make either of your application ActiveX EXE then
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 7th, 2000, 01:39 PM
#3
Thread Starter
New Member
And then just reference it in the other program like a activex dll? What's the syntax for this? Thanks much.
-Incredulous
-
Aug 7th, 2000, 02:10 PM
#4
transcendental analytic
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
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 7th, 2000, 02:30 PM
#5
Thread Starter
New Member
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]
-
Aug 7th, 2000, 04:20 PM
#6
transcendental analytic
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
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 7th, 2000, 06:17 PM
#7
Thread Starter
New Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|