Link to home
Start Free TrialLog in
Avatar of Ennovations
Ennovations

asked on

Send message from VB6, VBA, and VB.NET to VB.NET

We have a hand full of applications written in VB6, Access2003, and VB.NET.  I have written an application (App1) that launches these applications.  When the user clicks on the application button the application starts loading in the background but I want to have a status bar on App1 that runs until the selected application (App2) completes loading.  To do this I need to have App2 send back a message to App1 stating that it has finished laoding.  I have been testing having App2 send a message with SENDMESSAGE and having App1 catch that message with WndProc.  This has not worked and I'm not sure which or if both ends of the communication are not working.  Any help toward getting this to work or suggestions of better ways to do this would be greatly appriciated.


''''''''''''''''''''''''''''''''''''''''''''''''''''''
App1
''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)

        If m.ToString = "End" Then
            MsgBox("here!!!")
            StopLoad()
        End If
        MyBase.WndProc(m)
    End Sub

''''''''''''''''''''''''''''''''''''''''''''''''''''''
App2
''''''''''''''''''''''''''''''''''''''''''''''''''''''

Private Declare Function SendMessageSTRING Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Private Const WM_GETTEXT = &HD
Private Const WM_SETTEXT = &HC
Private Const EM_GETLINECOUNT = &HBA

....and once the program has loaded I have this line

SendMessageSTRING 3332, WM_SETTEXT, 256, "End"                          ' 3332 is from App1 System.Diagnostics.Process.GetCurrentProcess().Handle

I don't get any error messages....just don't get any result at all.
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial