Click here to Skip to main content
15,888,202 members
Home / Discussions / COM
   

COM

 
QuestionComponent Services->COM+->Add new component hangs, C++ Unmanaged COM DLL using C# Pin
scottdj10-Mar-08 13:08
scottdj10-Mar-08 13:08 
GeneralRe: Component Services->COM+->Add new component hangs, C++ Unmanaged COM DLL using C# Pin
Scott Dorman10-Mar-08 15:46
professionalScott Dorman10-Mar-08 15:46 
AnswerRe: Component Services->COM+->Add new component hangs, C++ Unmanaged COM DLL using C# Pin
scottdj10-Mar-08 17:22
scottdj10-Mar-08 17:22 
GeneralRe: Component Services->COM+->Add new component hangs, C++ Unmanaged COM DLL using C# Pin
Scott Dorman10-Mar-08 17:43
professionalScott Dorman10-Mar-08 17:43 
AnswerRe: Component Services->COM+->Add new component hangs, C++ Unmanaged COM DLL using C# Pin
scottdj10-Mar-08 18:06
scottdj10-Mar-08 18:06 
GeneralRe: Component Services->COM+->Add new component hangs, C++ Unmanaged COM DLL using C# Pin
Scott Dorman11-Mar-08 4:33
professionalScott Dorman11-Mar-08 4:33 
AnswerRe: Component Services->COM+->Add new component hangs, C++ Unmanaged COM DLL using C# Pin
scottdj10-Mar-08 17:48
scottdj10-Mar-08 17:48 
GeneralRe: Component Services->COM+->Add new component hangs, C++ Unmanaged COM DLL using C# Pin
Scott Dorman11-Mar-08 4:28
professionalScott Dorman11-Mar-08 4:28 
I can try...

When you start a .NET application, it must be run inside a specific sandbox (technically an AppDomain). Each process gets one AppDomain that is responsible for running (hosting) that process. Due to the way the runtime actually works, you can't have different versions of the runtime loaded in to the same process.

Normally, when you run an application it uses the version of the runtime that it was compiled against. However, a "third-party" application (such as Component Services) that is unmanaged must load (host) managed code it does so by loading the .NET runtime into it's memory space. The default behavior here is that the unmanaged process will always load the latest version of the runtime available on that machine. This means that if you have .NET 1.1 code it will be loaded and run under a .NET 2.0 environment.

scottdj wrote:
I have a C++ Unmanaged Console app, that does the COM Interop with the C# .NET 2.0 Class Lib, which in turn calls the C# .NET 1.1 Class Lib. This seems to work fine. So, in this case, nothing is registered via Component Services. I thought that the C# .NET 1.1 Class Lib would use .NET 1.1, and the C# .NET 2.0 Class Lib would use .NET 2.0. Are you saying that this is not the case?


In this situation, the C++ console app would host the 2.0 runtime in order to call the C# 2.0 library. In turn, the 1.1 library would also be running under the 2.0 runtime since it is all in the same process space. Normally this isn't an issue. There are ways to target specific runtime versions, see this MSDN article[^] for more information.

Scott.

—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai

[Forum Guidelines] [Articles] [Blog]

QuestionRe: Component Services->COM+->Add new component hangs, C++ Unmanaged COM DLL using C# Pin
scottdj11-Mar-08 15:25
scottdj11-Mar-08 15:25 
GeneralRe: Component Services->COM+->Add new component hangs, C++ Unmanaged COM DLL using C# Pin
Scott Dorman12-Mar-08 2:38
professionalScott Dorman12-Mar-08 2:38 
GeneralGet "Title" information from files Pin
souljumper10-Mar-08 4:10
souljumper10-Mar-08 4:10 
QuestionHandling Internet Explorer com server object in plain C++ Pin
jattila4010-Mar-08 2:13
jattila4010-Mar-08 2:13 
GeneralRe: Handling Internet Explorer com server object in plain C++ Pin
jattila4010-Mar-08 3:48
jattila4010-Mar-08 3:48 
GeneralLink File Path Pin
john56329-Mar-08 22:25
john56329-Mar-08 22:25 
QuestionCOM Interop C++ unmanaged through C# .NET 2.0 Class Library to C# .NET 1.1managed Class Library Pin
scottdj8-Mar-08 18:33
scottdj8-Mar-08 18:33 
QuestionRe: COM Interop C++ unmanaged through C# .NET 2.0 Class Library to C# .NET 1.1managed Class Library Pin
scottdj8-Mar-08 18:36
scottdj8-Mar-08 18:36 
GeneralRe: COM Interop C++ unmanaged through C# .NET 2.0 Class Library to C# .NET 1.1managed Class Library Pin
Scott Dorman10-Mar-08 15:49
professionalScott Dorman10-Mar-08 15:49 
Generalusing com without registration Pin
justintimberlake8-Mar-08 16:31
justintimberlake8-Mar-08 16:31 
GeneralRe: using com without registration Pin
User 2155979-Mar-08 3:14
User 2155979-Mar-08 3:14 
GeneralRe: using com without registration Pin
justintimberlake9-Mar-08 16:52
justintimberlake9-Mar-08 16:52 
GeneralRe: using com without registration Pin
User 21559710-Mar-08 11:32
User 21559710-Mar-08 11:32 
GeneralProxy Manager on Remote Clients Pin
swjam7-Mar-08 22:04
swjam7-Mar-08 22:04 
GeneralEvent Map of an ActiveX control Pin
AbbyIndian6-Mar-08 6:59
AbbyIndian6-Mar-08 6:59 
QuestionCOM Addin crashes Excel. What am I doing wrong? Pin
ssaddi3-Mar-08 19:35
ssaddi3-Mar-08 19:35 
GeneralRe: COM Addin crashes Excel. What am I doing wrong? Pin
Nathan Holt at EMOM4-Mar-08 9:42
Nathan Holt at EMOM4-Mar-08 9:42 

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.