Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Sat, 05 Apr 2008 12:16:54 +0100,    group: microsoft.public.platformsdk.com_ole        back       


DCOM without AppID value under CLSID (e.g. wrapper?)   
Hi,

(Two Machines, Client/Server COM/DCOM)

Q Is it possible to instantiate a remote object who'd CLSID does NOT 
have an AppID value?

I have a COM object (not mine) registered on both client and server 
computers, but it's NOT set up for remoting. If I try to instantiate the 
object from the client I get something like  "Automation Server can't 
create object". If I then create an AppID under HKCR and create an AppID 
value for the CLSID on the server, the client CAN create the object and 
it works as expected (It's a DLL and I have to also set the DllSurrogate 
value). No changes are required on the client.

Creating an AppID key under HKCR of the server is not an issue, but I 
don't want to create an AppID value under the CLSID on the server 
because ... it's a long story ... basically I don't want to mess with 
the registration.

Ways forward?

1. It's impossible

2. I read about using the CLSCTX enumeration to "over-ride registry 
values". Does that mean you could use it to create a remote object 
that's not set up for remoting? (seems unlikely!)

3. Is it possible to create a wrapper object on the remote machine, and 
use this new class to call the old class? The new class would have an 
AppID and set security.

-- 
Gerry Hickman (London UK)
date: Sat, 05 Apr 2008 12:16:54 +0100   author:   Gerry Hickman am

RE: DCOM without AppID value under CLSID (e.g. wrapper?)   
Hello Gerry,

From your post, my understanding on this issue is: you wonder how to 
consume a COM object that is not registered as COM+ from a remote client 
machine. If I'm off base, please feel free to let me know.

Because you mentioned it is impossible for you to register the COM object 
as COM+ in the server, I think the only method is to write a COM+ wrapper 
for the COM object, in other words, I agree with your 3rd solution: 
"create a wrapper object on the remote machine, and use this new class to 
call the old class? The new class would have an AppID and set security."

I don't think the second solution, CLSCTX, helps because the prerequisite 
of the remote execution context for CoCreate calls with the set of CLSCTX 
is that the component should support remoting.

Please let me know if you have any other concerns, or need anything else.

Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to 
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues 
where an initial response from the community or a Microsoft Support 
Engineer within 1 business day is acceptable. Please note that each follow 
up response may take approximately 2 business days as the support 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions or complex 
project analysis and dump analysis issues. Issues of this nature are best 
handled working with a dedicated Microsoft Support Engineer by contacting 
Microsoft Customer Support Services (CSS) at 
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
date: Mon, 07 Apr 2008 11:33:47 GMT   author:   (Jialiang Ge [MSFT])

Re: DCOM without AppID value under CLSID (e.g. wrapper?)   
Hi Jialiang Ge,

Thanks for the help with this.

> From your post, my understanding on this issue is: you wonder how to 
> consume a COM object that is not registered as COM+ from a remote client 
> machine. If I'm off base, please feel free to let me know.

My understanding is that you can a enable a classic COM class for DCOM 
(remote access) by creating an AppID for it, but this is NOT the same as 
COM+

?

> Because you mentioned it is impossible for you to register the COM object 
> as COM+ in the server,

How would I try to do this?

> I think the only method is to write a COM+ wrapper 
> for the COM object, in other words, I agree with your 3rd solution: 
> "create a wrapper object on the remote machine, and use this new class to 
> call the old class? The new class would have an AppID and set security."

Can you give more details on how I would actually do this? I don't mean 
every line of code, just the steps I'd need to perform. I'm especially 
interested in how to obtain a remotely accessible pointer in the wrapper 
object as if it was the pointer from the inner object?

> I don't think the second solution, CLSCTX, helps because the prerequisite 
> of the remote execution context for CoCreate calls with the set of CLSCTX 
> is that the component should support remoting.

OK, that makes sense, otherwise it would open a lot of security doors.

-- 
Gerry Hickman (London UK)
date: Wed, 09 Apr 2008 21:16:04 +0100   author:   Gerry Hickman am

Re: DCOM without AppID value under CLSID (e.g. wrapper?)   
Hello Gerry,

We can generally do the wrapper for the existing COM in two ways:
1. Containment
2. Aggregation

Suppose the old COM component is A, and the new one is B.
Containment means that, inside B, we have an internal reference to an A 
object, and define all the functions available from A in B. In these newly 
defined functions, we simply redirect the calls to the corresponding 
function in A object.
Aggregation means that, we return A when users query interfaces, so all the 
calls will be directly sent to A.

To make it clearer, I find serveral codeguru article:

Containment and Aggregation
http://www.codeguru.com/cpp/com-tech/atl/article.php/c3579/

Containment and Aggregation in DCOM
http://www.pantheon.com/journal/dcom.htm

I also recommend the book "Inside COM", which discusses Containment and 
Aggregation in detail in Chapter 8.

I personally think the implementation of Containment is easier than 
Aggregation and a sample of Containment is as follows:
http://www.codeproject.com/KB/COM/Containment.aspx
You can follow this sample to write the new COM, then register it as DCOM 
so that you client machine can call it. 
(http://support.microsoft.com/kb/246054)

Regards, 
Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
date: Thu, 10 Apr 2008 07:25:09 GMT   author:   (Jialiang Ge [MSFT])

Re: DCOM without AppID value under CLSID (e.g. wrapper?)   
Hi Jialiang Ge,

Thanks, this is very helpful. I'll have a good look at all these 
articles and the book. I saw an preview chapter of "Inside COM" and it 
does look very good.

> Hello Gerry,
> 
> We can generally do the wrapper for the existing COM in two ways:
> 1. Containment
> 2. Aggregation
> 
> Suppose the old COM component is A, and the new one is B.
> Containment means that, inside B, we have an internal reference to an A 
> object, and define all the functions available from A in B. In these newly 
> defined functions, we simply redirect the calls to the corresponding 
> function in A object.
> Aggregation means that, we return A when users query interfaces, so all the 
> calls will be directly sent to A.
> 
> To make it clearer, I find serveral codeguru article:
> 
> Containment and Aggregation
> http://www.codeguru.com/cpp/com-tech/atl/article.php/c3579/
> 
> Containment and Aggregation in DCOM
> http://www.pantheon.com/journal/dcom.htm
> 
> I also recommend the book "Inside COM", which discusses Containment and 
> Aggregation in detail in Chapter 8.
> 
> I personally think the implementation of Containment is easier than 
> Aggregation and a sample of Containment is as follows:
> http://www.codeproject.com/KB/COM/Containment.aspx
> You can follow this sample to write the new COM, then register it as DCOM 
> so that you client machine can call it. 
> (http://support.microsoft.com/kb/246054)
> 
> Regards, 
> Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> 
> =================================================
> Delighting our customers is our #1 priority. We welcome your comments and 
> suggestions about how we can improve the support we provide to you. Please 
> feel free to let my manager know what you think of the level of service 
> provided. You can send feedback directly to my manager at: 
> msdnmg@microsoft.com.
> 
> This posting is provided "AS IS" with no warranties, and confers no rights.
> =================================================
> 


-- 
Gerry Hickman (London UK)
date: Thu, 10 Apr 2008 20:43:23 +0100   author:   Gerry Hickman am

Re: DCOM without AppID value under CLSID (e.g. wrapper?)   
It's my pleasure. Any followup questions are welcome when you look into the 
Containment and Aggregation mechanisms.

Regards, 
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
date: Fri, 11 Apr 2008 03:03:52 GMT   author:   (Jialiang Ge [MSFT])

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us