Results 1 to 4 of 4

Thread: previous instance

  1. #1

    Thread Starter
    Addicted Member nota141's Avatar
    Join Date
    Feb 2000
    Location
    The place down there under everyone else.
    Posts
    224

    Question previous instance

    i have a program that uses command line args what i would like to do is if another instance is started that it tells the first what args it was sent and then closes. how can i do this
    On Error wake up and try again ;-)
    ___________________________
    ICQ # 65392645
    email - [email protected]

    Visual Studio 6 ent with SP5 Running on XP with an AMD 1.2 ThunderBird with 512 MB RAM And a 120GB primary HDD (very sweet)

  2. #2
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    You can check the previous instance by

    If App.PrevInstance Then
    .......
    End If


    But to pass arguments to an exe.. i don't know..

  3. #3
    Software Eng. Megatron's Avatar
    Join Date
    Mar 1999
    Location
    Canada
    Posts
    11,286

    Re: previous instance

    The "Command$" variable stores the all the command line arguments. e.g.
    Code:
    'Add to Load() event
    MsgBox Command$

  4. #4
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Talking Morning all you post-it-notes...

    It is not as simple as that/ You are both correct with what you have posted, but it is slightly more complicated to pass parameters to the other app. I think if you create an ActiveX EXE standalone application then you could get one to talk to the other by using a common module and passing a string to the main app, which you have to save in a collection...does that make sense?

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