1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Passing Values to a running VB application

Discussion in 'Software Development' started by duke_swh, Jan 14, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. duke_swh

    duke_swh Thread Starter

    Joined:
    Jan 14, 2006
    Messages:
    2
    Hello! I just recently joined this site and this is my first post.:) I just have one question, hope somebody can help me with this. I'm developing this application wherein an application(not mine) will pass a value(in this case, a phone number) to my application. Once received, my application will search and pull from the database any other information regarding this number. I am using VB6 as front end and SQL Server 2000 as backend. Please note that my application is running when the value is passed. Please help..
     
  2. aewarnick

    aewarnick

    Joined:
    Sep 3, 2002
    Messages:
    828
    In normal situations where the apps are running on the same computer...
    Use SendMessage with WM_USER. Look up SendMessage with google.

    Getting the handle to the other app is where you need to be creative.
    A) Have the other app get your window handle by window text.
    B) Have the other app read a text document that your program wrote when it started with the handle written in it.

    In your case. The only way I can think to do it is by a shared file containing the phone numebr to look up. Have the number producing app append to a text document, the phone number/separated by a certain character; #8973458754#3457658324...
    Have your app check that file for numbers on a loop making sure to sleep for 5 seconds or so - Sleep(5000) to give the number producing app a chance to open the file and write numbers. When your app reads the first number, remove it and write the text document anew. That is the short explanation. There are other details dealing with writing and reading files that I didn't get into.
     
  3. duke_swh

    duke_swh Thread Starter

    Joined:
    Jan 14, 2006
    Messages:
    2
    Thanks, aewarnick! You gave me a very good idea. What i did was develop a small app which will receive the values and in turn will create the text file that my other app will look to for the number. I don't have any control on the other software(the one passing the value), because it was developed by another company. I can only specify which app it should pass the value to and it has to launch that app from command line with the number as parameters, which in my case is impossible since my app is already running.
    Thanks for the help. I really appreciate it.
     
  4. RGregory

    RGregory

    Joined:
    Jul 27, 2005
    Messages:
    65
    Another possibility that I have used in the past (on mainframes, though it would work just as well on PC's <G>) is to have the calling program write the phone number out to a text file. Your program can check on a semi-regular basis to discover whether or not that file exists. When it does exist, read the information into your program, delete the file, and start the process over again.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/433976

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice