![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a AppDomain ID, how do I get the instance of the AppDomain Object? |
#3
| |||
| |||
|
|
John wrote: I have a AppDomain ID, how do I get the instance of the AppDomain Object? There might be a simpler way, but it looks to me like the only way to do this is to enumerate the app domains in the process, checking their id. There doesn't seem to be an unmanaged way to enumerate app domains - see http://groups.google.com/group/micro...4bf0af393 c28 for some code that uses the unmanaged, debug interface. -- .NET 2.0 for Delphi Programmers www.midnightbeach.com/.net Delphi skills make .NET easy to learn Great reviews & good sales. |
#4
| |||
| |||
|
|
Thx, but the EnumDomains only enumates the AppDomain in the current process, how about the AppDomain in other processes? Jon Shemitz wrote: John wrote: I have a AppDomain ID, how do I get the instance of the AppDomain Object? There might be a simpler way, but it looks to me like the only way to do this is to enumerate the app domains in the process, checking their id. There doesn't seem to be an unmanaged way to enumerate app domains - see http://groups.google.com/group/micro...4bf0af393 c28 for some code that uses the unmanaged, debug interface. -- .NET 2.0 for Delphi Programmers www.midnightbeach.com/.net Delphi skills make .NET easy to learn Great reviews & good sales. |
#5
| |||
| |||
|
|
I doubt that this is exposed in a readily available way. What is it that you are trying to do? -- - Nicholas Paldino [.NET/C# MVP] - mvp (AT) spam (DOT) guard.caspershouse.com "John" <johnxhc (AT) yahoo (DOT) com> wrote in message news:1158092028.572376.62600 (AT) d34g2000cwd (DOT) googlegroups.com... Thx, but the EnumDomains only enumates the AppDomain in the current process, how about the AppDomain in other processes? Jon Shemitz wrote: John wrote: I have a AppDomain ID, how do I get the instance of the AppDomain Object? There might be a simpler way, but it looks to me like the only way to do this is to enumerate the app domains in the process, checking their id. There doesn't seem to be an unmanaged way to enumerate app domains - see http://groups.google.com/group/micro...4bf0af393 c28 for some code that uses the unmanaged, debug interface. -- .NET 2.0 for Delphi Programmers www.midnightbeach.com/.net Delphi skills make .NET easy to learn Great reviews & good sales. |
#6
| |||
| |||
|
|
Basically, I want to use it as COM Global Interface Table, one app Appdomain running in one process, setup some object it wants to expose using Appdomain.SetData, another app in another process can use IcorPublish to enumerate all the appDomain in the system and find out the particular domain it is interesting. Get the AppDomainID, from the AppDomainID, get the AppDomain Object, using AppDomain.GetData get the Object, casting the Object to an interface pointer and use it. Of course I know that I could achieve the same thing with .NET Remoting, but it seem to me that if I could somehow get the AppDomain Object from the AppDomainID, it will be much simpler than using Remoting. |
|
John Nicholas Paldino [.NET/C# MVP] wrote: I doubt that this is exposed in a readily available way. What is it that you are trying to do? -- - Nicholas Paldino [.NET/C# MVP] - mvp (AT) spam (DOT) guard.caspershouse.com "John" <johnxhc (AT) yahoo (DOT) com> wrote in message news:1158092028.572376.62600 (AT) d34g2000cwd (DOT) googlegroups.com... Thx, but the EnumDomains only enumates the AppDomain in the current process, how about the AppDomain in other processes? Jon Shemitz wrote: John wrote: I have a AppDomain ID, how do I get the instance of the AppDomain Object? There might be a simpler way, but it looks to me like the only way to do this is to enumerate the app domains in the process, checking their id. There doesn't seem to be an unmanaged way to enumerate app domains - see http://groups.google.com/group/micro...4bf0af393 c28 for some code that uses the unmanaged, debug interface. -- .NET 2.0 for Delphi Programmers www.midnightbeach.com/.net Delphi skills make .NET easy to learn Great reviews & good sales. |
#7
| |||
| |||
|
|
Basically, I want to use it as COM Global Interface Table, one app Appdomain running in one process, setup some object it wants to expose using Appdomain.SetData, another app in another process can use IcorPublish to enumerate all the appDomain in the system and find out the particular domain it is interesting. Get the AppDomainID, from the AppDomainID, get the AppDomain Object, using AppDomain.GetData get the Object, casting the Object to an interface pointer and use it. Of course I know that I could achieve the same thing with .NET Remoting, but it seem to me that if I could somehow get the AppDomain Object from the AppDomainID, it will be much simpler than using Remoting. |
#8
| |||
| |||
|
|
John wrote: Basically, I want to use it as COM Global Interface Table, one app Appdomain running in one process, setup some object it wants to expose using Appdomain.SetData, another app in another process can use IcorPublish to enumerate all the appDomain in the system and find out the particular domain it is interesting. Get the AppDomainID, from the AppDomainID, get the AppDomain Object, using AppDomain.GetData get the Object, casting the Object to an interface pointer and use it. Of course I know that I could achieve the same thing with .NET Remoting, but it seem to me that if I could somehow get the AppDomain Object from the AppDomainID, it will be much simpler than using Remoting. It doesn't sound simpler! Remoting is very easy to use at a Hello World level, and that is perfectly adequate for many applications. It also supports additional complexity (lease management, channel sinks, &c) for the apps that need it. It's documented and supported; there are users out there who've probably solved any problem you'll run into. |
|
Seems a lot simpler than building your own infrastructure and increasing your reliance on (ugh!) COM. -- .NET 2.0 for Delphi Programmers www.midnightbeach.com/.net Delphi skills make .NET easy to learn Great reviews & good sales. |
#9
| |||
| |||
|
|
John wrote: Basically, I want to use it as COM Global Interface Table, one app Appdomain running in one process, setup some object it wants to expose using Appdomain.SetData, another app in another process can use IcorPublish to enumerate all the appDomain in the system and find out the particular domain it is interesting. Get the AppDomainID, from the AppDomainID, get the AppDomain Object, using AppDomain.GetData get the Object, casting the Object to an interface pointer and use it. Of course I know that I could achieve the same thing with .NET Remoting, but it seem to me that if I could somehow get the AppDomain Object from the AppDomainID, it will be much simpler than using Remoting. It doesn't sound simpler! Remoting is very easy to use at a Hello World level, and that is perfectly adequate for many applications. It also supports additional complexity (lease management, channel sinks, &c) for the apps that need it. It's documented and supported; there are users out there who've probably solved any problem you'll run into. Seems a lot simpler than building your own infrastructure and increasing your reliance on (ugh!) COM. -- .NET 2.0 for Delphi Programmers www.midnightbeach.com/.net Delphi skills make .NET easy to learn Great reviews & good sales. |
#10
| |||
| |||
|
|
"John" <johnxhc (AT) yahoo (DOT) com> wrote in message news:1158160939.979310.289370 (AT) e63g2000cwd (DOT) googlegroups.com... Basically, I want to use it as COM Global Interface Table, one app Appdomain running in one process, setup some object it wants to expose using Appdomain.SetData, another app in another process can use IcorPublish to enumerate all the appDomain in the system and find out the particular domain it is interesting. Get the AppDomainID, from the AppDomainID, get the AppDomain Object, using AppDomain.GetData get the Object, casting the Object to an interface pointer and use it. Of course I know that I could achieve the same thing with .NET Remoting, but it seem to me that if I could somehow get the AppDomain Object from the AppDomainID, it will be much simpler than using Remoting. You cannot directly use objects in another application, you need a proxy. The COM Running Object Table creates a proxy when you lookup an object. John Nicholas Paldino [.NET/C# MVP] wrote: I doubt that this is exposed in a readily available way. What is it that you are trying to do? -- - Nicholas Paldino [.NET/C# MVP] - mvp (AT) spam (DOT) guard.caspershouse.com "John" <johnxhc (AT) yahoo (DOT) com> wrote in message news:1158092028.572376.62600 (AT) d34g2000cwd (DOT) googlegroups.com... Thx, but the EnumDomains only enumates the AppDomain in the current process, how about the AppDomain in other processes? Jon Shemitz wrote: John wrote: I have a AppDomain ID, how do I get the instance of the AppDomain Object? There might be a simpler way, but it looks to me like the only way to do this is to enumerate the app domains in the process, checking their id. There doesn't seem to be an unmanaged way to enumerate app domains - see http://groups.google.com/group/micro...4bf0af393 c28 for some code that uses the unmanaged, debug interface. -- .NET 2.0 for Delphi Programmers www.midnightbeach.com/.net Delphi skills make .NET easy to learn Great reviews & good sales. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |