#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    2
    Rep Power
    0

    Exclamation how to send a message to anexternal program


    how can i do this?

    i have 2 running programs using the same database (Students and Subjects). then i have one more central program that also accesses the same db.

    i want it that when the central program makes any modification to the student or subject table, the other 2 programs would know it and they would execute appropriate code (like updating a listview).

    anyone please?
    thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    No es importante
    Posts
    2,065
    Rep Power
    14
    Are these web applications or desktop applications? One approach is to flag a field in the database that each application will check for on predefined intervals. If the flag is true they will execute their code. If the applications are able to communicate, via sockets or something similar you can have the `server` send the clients the commands directly.
  4. #3
  5. Doggie
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2003
    Location
    Seattle, WA
    Posts
    751
    Rep Power
    13
    You could also make the two smaller programs ActiveX apps, then call their methods from the bigger program. But that only works if they're all running on the same machine.

    If you have multiple student/subject programs running on multiple machines, with the bigger program running on a single machine, just have the smaller programs occasionaly quiry the main program via a TCP connection.

    Or just do what victorpendleton says and set a flag in the database.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    2
    Rep Power
    0
    is that how they really do it? i mean im willing to do what you both mentioned but is that an efficient method?
  8. #5
  9. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    Actually, if they are activex executables or dlls then no, they do not have to be on the same machine. You can connect via DCOM to create an instance of the object on another machine. You have to alter a couple of settings on the host machine to allow for the connection and then specify the computer to connect to via the CreateObject() function.
    i.e.
    Set myVar = CreateObject("your_object_name", "the_other_computer")
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2002
    Posts
    693
    Rep Power
    26
    Personally I would probably do this with the winsock control. Then it can be done without polling.

IMN logo majestic logo threadwatch logo seochat tools logo