Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-06-23
3
Medium Priority
?
835 Views
Last Modified: 2012-05-05
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.
0
Comment
Question by:Ennovations
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 16972792
Not exactly what you asked for...

How about a different approach?

        Label1.Text = "Loading"
        Dim p As Process = Process.Start("c:\test.exe")
        While Not p.WaitForInputIdle(50)
            Label1.Text &= "."
            Application.DoEvents()
        End While
        Label1.Text &= "Done"

WaitForInputIdle():
http://msdn2.microsoft.com/en-us/library/system.diagnostics.process.waitforinputidle.aspx
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question