StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Using VB6 ActiveX exe's from VB.NETExpand / Collapse
Author
Message
Posted 03/09/2007 3:59:24 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 2 days ago @ 4:06:22 PM
Posts: 313, Visits: 1,274
I am calling a VB6 ActiveX exe from my VB.NET application. It seems to work okay except I when I exit the program the executable is still running in the workstation processes. 

Here is the code used.

Dim AvRebuild as New RebuildUtility.clsRebuild()

AvRebuild.StartXRebuild(......)

I launch a number of other VB6 exe's using System.Diagnostics.Process, where I can add a handler so I can remove the process in the OnProcessExit event.  Is there something similar for ActiveX exe's?

Thanks

Tim

 

Post #7394
Posted 03/09/2007 4:27:18 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 5:04:58 PM
Posts: 4,780, Visits: 4,744
You can do this several ways...each process that is started has a unique process ID (PID) that you can capture, or if you are only going to have one instance on the machine you can just use the code below and close down all processes of that type.  The below code you would add in the FormClosing event (or something of that nature) in your main MDI window.

Dim loProcess As System.Diagnostics.Process

For Each loProcess IN System.Diagnostics.Process.GetProcessByName("MyProcessName")
    Try
        loProcess.Kill()
    Catch ex As Exception
    End Try
Next

Note: You DO NOT provide the extension of the process name.  Just name prefix.

Post #7395
Posted 03/09/2007 4:38:19 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 2 days ago @ 4:06:22 PM
Posts: 313, Visits: 1,274
Is it possible to trap the process ID based on how I am launching the application or can you only do this using System.Diagonstics.Process?
Post #7396
Posted 03/09/2007 5:12:16 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 5:04:58 PM
Posts: 4,780, Visits: 4,744
Well, I assume that since you are talking to the ActiveX control, the ActiveX control is the one launching the process.  If this is the case, then you are going to have to cycle through the processes.  If you launch a process directly then you have more control over capturing the PID.
Post #7397
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 3:14am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.125. 9 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.