Results 1 to 3 of 3

Thread: Question : passing value to variable in another program

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2009
    Posts
    40

    Question Question : passing value to variable in another program

    hello all sorry if title isn't clear enough

    let me explain quit tall words :

    i'm making program that deal with MS SQL Server 2000 and called it "ProgramA.exe"

    so at run time if the connection with Server is lost for any reason(Interned Down - Server Down -....etc) and there are function or sub that will deal with Server it will return error ,i already try to handle most Place that errors may occur,but how know
    so i design another application that make check for server every specific time (5 minutes) and called it "SrvChk.exe"

    and in program "Program A.exe" there are variable called "Srv_statue" that will hold value of connection "Connected" or "Error returned"

    so now question is :

    how to make the second application "SrvChk.exe" after check connection to server Pass the value to variable in Program 1 "Program A" that Called "Srv_statue" ??

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Question : passing value to variable in another program

    There are various solutions. Search the forum for IPC (interprocess communication). Here are a few possibilities.
    1. Use DDE to talk between the two apps
    2. Use a shared text file, physical or mapped
    3. Use SetWindowText API to send a string to a hidden textbox
    4. Use subclassing and pass/trap WM_COPYDATA or a custom message
    5. Pass your srvCheck.exe, in a command line, information it can us to talk to your main app; srvCheck parses Command$ variable.
    6. About a 1/2 dozen other possibilities that may be combinations of the above or similar
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: Question : passing value to variable in another program

    You can use Named Pipes. There are a lot of examples already on the forums and on planet-source-code.com

Tags for this Thread

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