Results 1 to 7 of 7

Thread: How do I pass an object between programs?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    4

    Question

    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

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    4
    And then just reference it in the other program like a activex dll? What's the syntax for this? Thanks much.
    -Incredulous

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    4
    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]

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.

  7. #7

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    4
    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
  •  



Click Here to Expand Forum to Full Width