Re: Launching ActiveX applications from .Net

Matthew McDonald <[email protected]> Wed, 31 Jan 2007 10:25:29 -0700
Newsgroups gmane.comp.windows.devel.dotnet.cx
Message-ID <[email protected]>
Simon,

You may want to try using the System.Diagnostics.Process class to start the
.EXE file instead.

Here's a decent tutorial on System.Diagnostics.Process:
http://www.codeproject.com/csharp/start_an_external_app.asp?df=100&forumid=15700&exp=0&select=1716842

As Efran mentioned, Process.Close() might be of interest to you since it
will close the process that calls it and can therefor be used to close the
console application.

I hope this helps some.

-Matt McDonald


On 1/31/07, Simon Cansick <[email protected]> wrote:
>
> Matt - Just creating a reference to the COM component in Visual Studio
> 2005, .Net wrappers this object and I interact with it as a 'normal' .Net
> object.
>
> After I've created the object, I call a method which displays the
> GUI.  Here are the two lines of code:
>
>             openItems.starterClass starter = new openItems.starterClass();
>             starter.start(tempConnection, "SU");
>
>
> Thanks,
> Simon
>
>
>
> -----Original Message-----
> From: Discussion relating to the specifics of the C# and Managed C++
> languages [mailto:[email protected]] On Behalf Of Matthew
> McDonald
> Sent: 31 January 2007 15:29
> To: [email protected]
> Subject: Re: [DOTNET-CX] Launching ActiveX applications from .Net
>
> Simon,
>
> Are you using System.Diagnostics.Process or some other method to start the
> VB6 applications?
>
> -Matt McDonald
>
>
> On 1/31/07, Simon Cansick <[email protected]> wrote:
> >
> > Chaps,
> >
> > I'm working on a project that requires me to launch legacy ActiveX Exe
> > (VB6) applications from .Net (I'm using C#)
> >
> > I've created a console application that successfully launches my
> > ActiveX applications, but these applications are destroyed when that
> > console application terminates.
> >
> > Well kind of destroyed, the GUI terminates, but the process lingers on
> > according to Task Manager.
> >
> > So I've been trying to find a way of creating a thread, launching my
> > ActiveX, then destroying the 'parent' thread (I believe this is called
> > an orphaned thread), because I don't want the console app to continue.
> > But I've not had much luck.
> >
> > Has anyone got experience in this area?
> >
> > Simon James
> >
> > The contents of this email are confidential to the intended recipient
> > and may not be disclosed. Although it is believed that this email and
> > any attachments are virus free, it is the responsibility of the
> > recipient to confirm this.
> >
> > Smith & Williamson Corporate Finance Limited - A member of the London
> > Stock Exchange.
> > A member of M&A International Inc. http://www.mergers.net  Registered
> > in England No. 4533970. Authorised and regulated by the Financial
> > Services Authority Smith & Williamson Investment Management Limited,
> > Registered No. 976145.
> > Authorised and regulated by the Financial Services Authority.
> > Smith & Williamson Pension Consultancy Limited - Independent
> Intermediary.
> > Registered No. 3133226. Authorised and regulated by the Financial
> > Services Authority.
> > Smith & Williamson Fund Administration Limited, Registered No. 1934644.
> > Authorised and regulated by the Financial Services Authority.
> > Smith & Williamson Limited - A member of Nexia International.
> > Registered in England No. 4534022. Regulated by the Institute of
> > Chartered Accountants in England & Wales for a range of investment
> business activities.
> > NCL Investments Limited, Registered No. 1913794.
> > Member of the London Stock Exchange authorised and regulated by the
> > Financial Services Authority.
> >
> > Registered Office: 25 Moorgate, London EC2R 6AY
> > Telephone: 020 7131 4000 http://www.smith.williamson.co.uk
> >
> > Nexia Smith & Williamson Audit Limited - A member of Nexia
> International.
> > Registered in England No. 4469576.
> > Nexia Smith & Williamson Audit Limited is a company registered to
> > carry out audit work and is regulated for a range of investment
> > activities by the Institute of Chartered Accountants in England and
> > Wales.  Smith & Williamson Limited is a separate company that provides
> > professional resources and certain services to Nexia Smith &
> > Williamson Audit Limited under the terms of a formal agreement on an
> armâEUR(tm)s length basis.
> >
> > Registered Office: 25 Moorgate, London EC2R 6AY
> > Telephone: 020 7131 4000 http://www.nexiasmith.williamson.co.uk
> >
> > All telephone calls are recorded for business purposes.
> >
> > ===================================
> > This list is hosted by DevelopMentor(r)  http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com