CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Faltering Windows support
  • Internet Explorer 8 Click Clever Click Safe
  • Release Candidate 2 for ASP.NET MVC 2
  • Learn How to Create Dual Mode Windows Services

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual Basic Programming > Visual Basic .NET
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual Basic .NET Microsoft Visual Basic .NET and related questions.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old October 11th, 2009, 11:00 PM
    geoff_field geoff_field is offline
    Junior Member
     
    Join Date: Oct 2009
    Posts: 3
    geoff_field is an unknown quantity at this point (<10)
    Attaching To Existing 3rd Part ActiveX Application

    We have a client who has asked us to write a GUI that is capable of connecting to an existing, running application. This specific application has quite extensive .NET and ActiveX hooks in it, but it's a third-party application and we do not have access to the source code. The client has specified VB 2008, despite the fact that the target application has perfectly good GUI creation tools itself.

    I can successfully start a separate instance of the target application, but that is not what the client wants. The idea is that the user would start this application, open a specific file with it and then start the GUI which would take control.

    I have searched a number of locations (including 18 pages so far of this forum) to try to find help on this sort of thing, but the success is slow coming. One code snippet enabled me to find the running process, which may help me to connect. I am also browsing CodeProject to try to wind useful information on this.

    Does anybody have pointers to good information that might speed up my search?

    Thanks,

    Geoff
    Reply With Quote
      #2    
    Old October 11th, 2009, 11:08 PM
    geoff_field geoff_field is offline
    Junior Member
     
    Join Date: Oct 2009
    Posts: 3
    geoff_field is an unknown quantity at this point (<10)
    Re: Attaching To Existing 3rd Part ActiveX Application

    Oh yes, the GUI still has to be able to continue running if the third-party application is not installed.
    Reply With Quote
      #3    
    Old October 12th, 2009, 01:54 AM
    dglienna's Avatar
    dglienna dglienna is offline
    ex MVP - Visual Basic
    Power Poster
     
    Join Date: Jan 2006
    Location: Chicago, IL
    Posts: 10,288
    dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+)
    Re: Attaching To Existing 3rd Part ActiveX Application

    How about some details? No two programs are the same, and some aren't allowed to discuss here
    __________________
    David CodeGuru Article: Bound Controls are Evil-VB6
    101 Samples: VB & C# VS2008 Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!
    Reply With Quote
      #4    
    Old October 12th, 2009, 02:03 AM
    geoff_field geoff_field is offline
    Junior Member
     
    Join Date: Oct 2009
    Posts: 3
    geoff_field is an unknown quantity at this point (<10)
    Re: Attaching To Existing 3rd Part ActiveX Application

    Hi David,

    The target application is National Instruments' TestStand. It has a significant amount of documentation and a number of available interfaces, including Interop APIs.

    What I'm looking for are clues to the type of calls I should be looking at. Have other people done similar things with other applications? If so, how? What calls did they use? Once I see some examples, I can look for similar examples in the NI-supplied interfaces.

    As I said, TestStand has excellent GUI-building capabilities, particularly when allied with the underlying LabVIEW language. However, our clients are insisting on VB. NI do provide examples, but the code they provide can only open a new instance of TestStand. Connecting to an already-running instance is proving somewhat obscure for me.

    Regards,

    Geoff
    Reply With Quote
      #5    
    Old October 12th, 2009, 06:45 PM
    dglienna's Avatar
    dglienna dglienna is offline
    ex MVP - Visual Basic
    Power Poster
     
    Join Date: Jan 2006
    Location: Chicago, IL
    Posts: 10,288
    dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+) dglienna has a brilliant future (2000+)
    Re: Attaching To Existing 3rd Part ActiveX Application

    Well, if they have API's, that's probably the best way to interact. That's how we talk to Google, and Facebook, and a bunch of sites.
    __________________
    David CodeGuru Article: Bound Controls are Evil-VB6
    101 Samples: VB & C# VS2008 Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!
    Reply With Quote
      #6    
    Old October 18th, 2009, 11:43 PM
    TT(n)'s Avatar
    TT(n) TT(n) is offline
    Member +
     
    Join Date: Jun 2004
    Location: NH
    Posts: 576
    TT(n) is a glorious beacon of light (400+) TT(n) is a glorious beacon of light (400+) TT(n) is a glorious beacon of light (400+) TT(n) is a glorious beacon of light (400+) TT(n) is a glorious beacon of light (400+) TT(n) is a glorious beacon of light (400+)
    Re: Attaching To Existing 3rd Part ActiveX Application

    Could you please specify what kind of connection.

    Are you trying to automate this existing application?
    Here are some common API functions that could be called.

    Code:
    FindWindow
    FindWindowEx
    SendMessage
    PostMessage
    ShowWindow
    MoveWindow
    You may also use the Process class, to manipulate or get information about running processes.

    Code:
            For Each p As Process In Process.GetProcesses
                MessageBox.Show(p.ProcessName)
            Next
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual Basic Programming > Visual Basic .NET


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 08:16 AM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.