Results 1 to 9 of 9

Thread: How To?? [RESOLVED]

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    22

    How To?? [RESOLVED]

    I have app1 that does some processing on some tables. I have app2 that is already running. I want to tell app2 that app1 has finished and its ok to crunch the numbers. Now I know there are a number of ways that this can be done, but I want the BEST way to do this...can someone enlighten me

    Cheers
    Essex
    Last edited by Essex; Jan 12th, 2003 at 04:33 AM.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    That is really just a matter of opinion, so which ever way YOU think is best of the many ways is the right one.

  3. #3
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308
    I think it will be easier to use clipboard.

    As soon as app1 completes the processing, set a flag on the clipboard, in app2 you should have a timer which checks after specified time, whether the processing has been completed from app1 or not.

  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    I would've done the same but using a standard text file with a 0 or 1 value written to it by app1 depending on whether this was excecuting or has finished running.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  5. #5
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803
    I had the same problem when I had to send a "completion" message to my app from the ActiveX exe thread.

    Here't what I did:
    In the program that has to tell the other app that it completed
    VB Code:
    1. Private Const WM_MOUSEMOVE = &H200
    2.  
    3. Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    4.  
    5.  
    6. ' to send the message ...
    7. PostMessage m_hWnd, WM_MOUSEMOVE, 0, MAKELONG(0, -32768)
    8.  
    9.  
    10. Public Function MAKELONG(wLow As Long, wHigh As Long) As Long
    11.     MAKELONG = LOWORD(wLow) Or (&H10000 * LOWORD(wHigh))
    12. End Function

    And in the app where you receive the message
    VB Code:
    1. ' the form has to have the ScaleMode set to pixels, otherwize you will have to convert the Y to pixels...
    2. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    3.     If Y = -32768 Then
    4.         ' message received
    5.     End If
    6. End Sub

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    22
    Thanks for your replies fellas, but the solution is still a flag/poll style. I thought there might be a way that I could expose a function in app2 that I could call from app1.

    What I'm trying to do is Hotsync my PC app with a Palm Pilot app. I have written a custom conduit to perform all the necessary operations but I now need to tell app2 "process the tables and update the controls (treeview)". So what I have been thinking is...if I create an ActiveX.exe control and attach it to app2 then call it from app1, the events in the AX control will fire, app1 has finished, as the call to the AX is its last job and the event in the AX control will then update the tables and treeview control. Does this sound plausible?? Do you think it will work the way I imagine it to?? I don't have any expertise in AX area so I'm working blind and the time to finish the project is fast approaching so the flag solution is looking more like the short term fix.

    Regards
    Essex

  7. #7
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    If you want to use an ActiveX Exe then this may help:
    http://www.edneeis.com/samples.htm#ShareBetweenApps

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Posts
    22
    Thanks Edneeis, just what the doctor ordered I have bookmarked your site to go back and have another look at some of the other stuff you have done.

    Cheers
    Essex

  9. #9
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I'm glad you found it useful.

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