Click here to Skip to main content
16,005,121 members
Home / Discussions / C#
   

C#

 
GeneralRe: Check for LAN connection Pin
sharathgowda21-Feb-05 18:20
sharathgowda21-Feb-05 18:20 
GeneralRe: Check for LAN connection Pin
Stefan Troschuetz21-Feb-05 21:33
Stefan Troschuetz21-Feb-05 21:33 
GeneralTo define an action after my software' installation Pin
Anonymous21-Feb-05 0:20
Anonymous21-Feb-05 0:20 
GeneralRe: To define an action after my software' installation Pin
Heath Stewart21-Feb-05 8:08
protectorHeath Stewart21-Feb-05 8:08 
GeneralDoc to PDF conversion codes... Pin
Member 172116521-Feb-05 0:09
Member 172116521-Feb-05 0:09 
GeneralRe: Doc to PDF conversion codes... Pin
Heath Stewart21-Feb-05 7:20
protectorHeath Stewart21-Feb-05 7:20 
GeneralCOM DCOM multi client model Pin
sokettepower20-Feb-05 23:33
sokettepower20-Feb-05 23:33 
GeneralRe: COM DCOM multi client model Pin
Heath Stewart21-Feb-05 7:09
protectorHeath Stewart21-Feb-05 7:09 
That's the way is supposed to work. It's a class and it gets created by the underlying language/framework in which the COM class was written. If it's a control, there's no way to have only a single instance parented in different containers unless you moved it around each time a container becomes visible.

If it's an out-of-process server, you can connect to only a single instance, but that article you linked (and in the future, please use an actual hyperlink - buttons below the message post text box can help you with that and it saves our time) is far, far from teaching how to do that. Hopefully you've read a lot about COM interop from Interoperating with Unmanaged Code[^] in the .NET Framework SDK. You'll need to.

Exposing a single instance out-of-proc COM server - like the various Office applications - requires that you perform the same steps you read about, but you're also going to need to declare more interfaces that are defined for COM servers and clients, as well as native APIs like CreateClassMonikder. Some interfaces are already defined for you in the System.Runtime.InteropServices namespace, like UCOMIBindCtx, but you will need to create others.

You'll want to read[^] and learn about the IRunningObjectTable (ROT), which you'd load your out-of-proc COM server's Application object's CLSID into using CreateClassMoniker to get a UCOMIMoniker and load it into the ROT using the functionality you'll be exposing using the classes and interfaces mentioned in the documented linked above. Read Exposing the Application Object[^] for more about the Application object (as it's supposed to be called, but could be anything, actually) that represents your actual out-of-process COM server (EXE).

You should read Component Object Model (General)[^] and Automation[^] in the Platform SDK for more information. .NET can work hand-in-hand with COM but there's no class library that exposes everything you need and there's still a lot of manual labor involved with accessing and exposing COM objects because it's a vastly older system that's a lot more delecate than .NET.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralAny other ways to convert .net to vb 6.0 Pin
montu337720-Feb-05 22:11
montu337720-Feb-05 22:11 
GeneralRe: Any other ways to convert .net to vb 6.0 Pin
Judah Gabriel Himango21-Feb-05 6:11
sponsorJudah Gabriel Himango21-Feb-05 6:11 
GeneralRe: Any other ways to convert .net to vb 6.0 Pin
montu337721-Feb-05 6:16
montu337721-Feb-05 6:16 
GeneralRe: Any other ways to convert .net to vb 6.0 Pin
Heath Stewart21-Feb-05 6:51
protectorHeath Stewart21-Feb-05 6:51 
GeneralSMS Application Pin
A Khan20-Feb-05 22:06
sussA Khan20-Feb-05 22:06 
GeneralRe: SMS Application Pin
Heath Stewart21-Feb-05 6:45
protectorHeath Stewart21-Feb-05 6:45 
QuestionGood security project idea in C#? Pin
Mohammed Aijaz Mohiuddin20-Feb-05 20:22
Mohammed Aijaz Mohiuddin20-Feb-05 20:22 
AnswerRe: Good security project idea in C#? Pin
Mohammed Aijaz Mohiuddin20-Feb-05 20:23
Mohammed Aijaz Mohiuddin20-Feb-05 20:23 
QuestionPanel Layout problem? Pin
Tee+20-Feb-05 16:43
Tee+20-Feb-05 16:43 
GeneralOverride wait cursor Pin
eggie520-Feb-05 16:29
eggie520-Feb-05 16:29 
GeneralI'd like to use the column like the header column in DataGrid Pin
yu-yu20-Feb-05 14:41
yu-yu20-Feb-05 14:41 
GeneralDatasets and Web Services Pin
ronin177020-Feb-05 14:01
ronin177020-Feb-05 14:01 
GeneralRe: Datasets and Web Services Pin
Kodanda Pani20-Feb-05 18:24
Kodanda Pani20-Feb-05 18:24 
GeneralTimer on a new thread Pin
eggie520-Feb-05 12:15
eggie520-Feb-05 12:15 
GeneralRe: Timer on a new thread Pin
S. Senthil Kumar20-Feb-05 13:20
S. Senthil Kumar20-Feb-05 13:20 
GeneralRe: Timer on a new thread Pin
eggie520-Feb-05 14:35
eggie520-Feb-05 14:35 
GeneralRe: Timer on a new thread Pin
eggie520-Feb-05 15:08
eggie520-Feb-05 15:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.