Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 30th, 2005, 08:45 AM
Registered User
 
Join Date: Aug 2005
Location: , Texas, .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Get running Instance of a Process not in ROT?

Anyone,

I am using C# code to start and interact with Microstation and have run into a small problem that I can't figure out.

The following code gets the running machine processes and if "ustation" is not already running starts Microstation.
This works great!

If "ustation" is already running, the following code tries to obtain a running instance of Microstation by looking the application up in the Running Object Table.
This fails because Microstation does not register itself in the ROT.

How do I return an object.type (comparable to the return type of GetActiveObject) that is attached to a running process not in the ROT?

Here is the code I am using...

try
{ Process[] ustationProcesses = Process.GetProcessesByName("ustation");

if ( ustationProcesses.Length == 0 )
    {
     app = new MicroStationDGN.Application();
    }
else
    {
     app = (MicroStationDGN.Application)System.Runtime.Intero pServices.Marshal.GetActiveObject("MicroStationDGN .Application");
    }
     return(app);
}
catch (System.Exception ex)
{
MessageBox.Show("Starting Microstation generated the following exception:\n"+ex.ToString());
}

BTW, the code works for AutoCAD; It registers itself in the ROT.

Thanks in advance for any input...
Daren....
Reply With Quote
  #2 (permalink)  
Old February 20th, 2018, 01:06 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2018
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default did you ever figure anything out

I know this is a really old post. but I have the same problem.
did you ever figure out another way to do this?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
process.startinfo opens new instance of process Anypond General .NET 0 August 28th, 2008 05:35 AM
Finding commandline arguments of a running process EddyT C# 4 July 1st, 2007 10:07 AM
Know about a running process for a given resource baburman General .NET 2 October 13th, 2005 03:04 AM
Check Multiple running Instance of DTS Package greenash SQL Server DTS 0 January 3rd, 2005 09:33 AM
Running VS 2002 & 2003 sharing one instance of MSD kevin777 VS.NET 2002/2003 8 October 24th, 2004 11:43 PM



All times are GMT -4. The time now is 11:32 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.