1

Topic: Works in COM, does not work in DCOM?

All greetings! The CATFISH-SERVER implements about such interface: [Guid ("xx. xx")] [InterfaceType (ComInterfaceType. InterfaceIsDual)] [ComVisible (true)] public interface IInfoComVersions {string Name {get;} System. Version VersionAccembly {get;} System. Diagnostics. FileVersionInfo VersionFile {get;}} [Guid ("xx. xx")] [InterfaceType (ComInterfaceType. InterfaceIsDual)] [ComVisible (true)] public interface IMyServer {IInfoComVersions InfoComVersions {get;} } I receive object of type IMyServer on the client, I look property InfoComVersions. VersionFile - all Ok... The DCOM-server (it is launched on the local computer) implements just the same interface: I receive object of type IMyServer - at attempt to consider property InfoComVersions. VersionFile (all remaining is normal) arises exception: HResult =-2147467262 it was not possible to result object type "System. __ ComObject" to type "System. Diagnostics. FileVersionInfo".... In System.StubHelpers.InterfaceMarshaler.ConvertToManaged (IntPtr pUnk, IntPtr itfMT, IntPtr classMT, Int32 flags) in Common.COM.Interfaces.IInfoComVersions.get_VersionFile () Why so happens (i.e., works in the CATFISH, but does not work in DCOM) and how with it to struggle? Thanks... PS. Win7 x64.NET4.5.1 VS2013

2

Re: Works in COM, does not work in DCOM?

Hello, mDmitriy, you wrote: System. Version System. Version unless COM it is compatible? At DCOM  so should be either  or ByRef If you want to use  objects that them it is necessary to envelop through IReflect. For example http://infostart.ru/public/238584/ http://files.rsdn.ru/19608/FilesForNetO … spatch.zip

3

Re: Works in COM, does not work in DCOM?

Hello, Serginio1, you wrote: S> System. Version unless COM it is compatible? At DCOM  so should be either  or ByRef S> If you want to use  objects that them it is necessary to envelop through IReflect. For example System. Version c COM to itself it is quite compatible, (that is visible from its code) therefore works without problems of Marshaling at the CATFISH and DCOM identical and if System. Diagnostics. FileVersionInfo not  in DCOM, most likely, because of safety It is marked as attribute [PermissionSet (SecurityAction. LinkDemand, Name = "FullTrust")] I waited that somebody prompts to me in this direction PS. What for you gave references to examples for operation with 1? Moreover written by the person, to put it mildly, not excellent knowing C# (Russian-speaking designations simply killed) 1 to me it is not necessary, at me from both sides managed code

4

Re: Works in COM, does not work in DCOM?

Hello, mDmitriy, you wrote: D> PS. What for you gave references to examples for operation with 1? D> Moreover written by the person, to put it mildly, not excellent knowing C# (Russian-speaking designations simply killed) D> 1 to me it is not necessary, at me from both sides managed code you Offend In COM at you any  is not present. 1 in this case as an example of usage Net of classes through COM. If you use managed code from two , the best decision it WCF

5

Re: Works in COM, does not work in DCOM?

Hello, Serginio1, you wrote: D>> PS. What for you gave references to examples for operation with 1? D>> Moreover written by the person, to put it mildly, not excellent knowing C# (Russian-speaking designations simply killed) D>> 1 to me it is not necessary, at me from both sides managed code S> you Offend well, excuse... If the person writes in 1 and slightly adds it on # the code quite to itself normal S> In COM at you any  is not present. How it is not present??? S> 1 in this case as an example of usage Net of classes through COM. A specific example, say, so... In MSDN examples are more evident S> If you use managed code from two sides the best decision it WCF WCF I looked - difficult too and heaped up too

6

Re: Works in COM, does not work in DCOM?

Hello, mDmitriy, you wrote: D> Hello, Serginio1, you wrote: D>>> PS. What for you gave references to examples for operation with 1? D>>> Moreover written by the person, to put it mildly, not excellent knowing C# (Russian-speaking designations simply killed) D>>> 1 to me it is not necessary, at me from both sides managed code S>> you Offend D> well, excuse... If the person writes in 1 and slightly adds it on # the code quite to itself normal S>> In COM at you any  is not present. D> as it is not present??? And you in a debugger look. Actually there the business there there is an interaction directly without RCW and CCW (if it is finite DLL) https://msdn.microsoft.com/ru-ru/librar … o/eaw10et3 (v=vs.100).aspx S>> 1 in this case as an example of usage Net of classes through COM. D> a specific example, say, so... In MSDN examples more visually But there are not present much. An essence what to envelop a class, the object, listing,  and to work with it through IDispatch. S>> If you use managed code from two sides the best decision it WCF D> WCF I looked - difficult too and You heaped up too simply are not able to prepare them. Simply COM, Remoting it the last century.

7

Re: Works in COM, does not work in DCOM?

Hello, Serginio1, you wrote: S> And you in a debugger look. Actually there the business there there is an interaction directly without RCW and CCW (if it is finite DLL) S> https://msdn.microsoft.com/ru-ru/librar … o/eaw10et3 (v=vs.100).aspx for a debugger will not tell... But on your links there is head "Marshaling with the help COM - interactions" S> But there there is no much. An essence what to envelop a class, the object, listing,  and to work with it through IDispatch. Well it yes... Through IDispatch was more general-purpose but besides for uncontrollable code D>> WCF I looked - difficult too and heaped up too S> You simply are not able to prepare them. Simply COM, Remoting it the last century. I am not able, I admit... And the entrance threshold seemed to me high COM and DCOM - quite itself working horsies... Them it is necessary only correctly when it is necessary and as it is necessary

8

Re: Works in COM, does not work in DCOM?

Hello, mDmitriy, you wrote: D> Hello, Serginio1, you wrote: S>> And you in a debugger look. Actually there the business there there is an interaction directly without RCW and CCW (if it is finite DLL) S>> https://msdn.microsoft.com/ru-ru/librar … o/eaw10et3 (v=vs.100).aspx D> for a debugger will not tell... But on your links there is head "Marshaling with the help COM - interactions" Between processes yes, and here if it is the internal server that is not present. S>> But there there is no much. An essence what to envelop a class, the object, listing,  and to work with it through IDispatch. D> well it yes... Through IDispatch is is more general-purpose D> but besides for the uncontrollable code And at  the big difference is not present. It will be simple at IDispatch two interprocessor calls instead of one and that dynamic it is optimized for repeated operations. D>>> WCF I looked - difficult too and heaped up too S>> You simply are not able to prepare them. Simply COM, Remoting it the last century. D> I am not able, I admit. . And the entrance threshold seemed to me high D> COM and DCOM - quite itself working horsies... Them it is necessary only correctly when it is necessary and as it is necessary WCF for the majority of tasks even is easier than COM. The main thing to spend 1 day for learning and a spelling. The huge role is played by configuration files. https://msdn.microsoft.com/ru-ru/library/ms734712 (v=vs.110).aspx https://msdn.microsoft.com/ru-ru/library/ms731184 (v=vs.110).aspx https://msdn.microsoft.com/ru-ru/library/ms731935 (v=vs.110).aspx

9

Re: Works in COM, does not work in DCOM?

Hello, Serginio1, you wrote: S> Between processes yes, and here if it is the internal server that is not present. S> And at  the big difference is not present. It will be simple at IDispatch two interprocessor calls instead of one and that dynamic it is optimized for repeated operations. S> WCF for the majority of tasks even is easier than COM. The main thing to spend 1 day for learning and a spelling. S> the huge role is played by configuration files. Clearly, thanks...