PDA

Click to See Complete Forum and Search --> : How To?? [RESOLVED]


Essex
Jan 7th, 2003, 05:21 AM
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

Edneeis
Jan 7th, 2003, 10:35 AM
That is really just a matter of opinion, so which ever way YOU think is best of the many ways is the right one.

usamaalam
Jan 9th, 2003, 04:26 PM
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.

alex_read
Jan 10th, 2003, 05:09 AM
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.

CVMichael
Jan 10th, 2003, 01:43 PM
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

Private Const WM_MOUSEMOVE = &H200

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


' to send the message ...
PostMessage m_hWnd, WM_MOUSEMOVE, 0, MAKELONG(0, -32768)


Public Function MAKELONG(wLow As Long, wHigh As Long) As Long
MAKELONG = LOWORD(wLow) Or (&H10000 * LOWORD(wHigh))
End Function


And in the app where you receive the message

' the form has to have the ScaleMode set to pixels, otherwize you will have to convert the Y to pixels...
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Y = -32768 Then
' message received
End If
End Sub

Essex
Jan 11th, 2003, 05:59 AM
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

Edneeis
Jan 11th, 2003, 12:07 PM
If you want to use an ActiveX Exe then this may help:
http://www.edneeis.com/samples.htm#ShareBetweenApps

Essex
Jan 12th, 2003, 03:15 AM
Thanks Edneeis, just what the doctor ordered :D I have bookmarked your site to go back and have another look at some of the other stuff you have done.

Cheers
Essex

Edneeis
Jan 12th, 2003, 03:20 AM
I'm glad you found it useful.