Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 15th, 2007, 04:10 AM
Authorized User
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default check whether COM object exists

hi folks,

I'm trying to check whether or not an application is running by testing whether a COM object exists for a given file (I can't use Process.GetProcessesByName() as the file I need to test is not the exe itself; we have a generic environment which runs a number of such apps and I need to be able to distinguish between them). In C++ I would attempt to bind to it and check whether or not I succeeded, though I'm unsure how to achieve the same thing with C#.

At first I thought this might work:
Code:
object obj = null;
try
{
obj = System.Runtime.InteropServices.Marshal.BindToMoniker(filemoniker);
but as you probably know that actually causes my application to run. So far googling hasn't helped, so any feedback would be much appreciated!

Ed.
Ne auderis delere orbem rigidum meum!
__________________
Ed.
Ne auderis delere orbem rigidum meum!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Check if Div Layer/Object Exists lian_a Javascript How-To 5 April 23rd, 2008 01:53 AM
Check if Object Exists in the Database Coby Access VBA 2 June 7th, 2007 02:56 PM
How to check if exists BEFORE the Insert rtr1900 Classic ASP Databases 0 December 20th, 2006 07:04 AM
check whether a particular session exists or not chayanvinayak PHP How-To 1 May 1st, 2006 04:09 PM
how to check that node is exists debuajm General .NET 0 June 8th, 2004 02:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.