Re: Is it posible to create COM in .Net C#
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Sat, 17 Sep 2005 00:12:48 +0200
"apm" <Contributor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1nCWe.11753$nq.2460@xxxxxxxxxxxxx
>
> What security checks are there and how can they be turned off?
>
> When an array of 10,000 double is passed from COM to .NET it is copied
> (passed by value). In order to make it behave like an array passed by
> reference the array is copied again when control returns to COM. COM
> components all running in the same process will pass arrays by passing a
> reference. This takes very little time because one pointer is passed. When
> COM passes to .NET 10,000 doubles are copied twice unless the default
> marshaling is overridden.
>
>> Now, if you take care that COM objects live in the callers apartment
>
> I'd like to know how to run a COM object in a .NET object's appartment.
>
> and if you turn-off the security checks performed when calling
>> into COM or from COM, the call overhead is some 30 instructions per call
>> (~10-15 nsec. on entry type PC ), this is what I call negligible.
>>
>> Willy.
>>
>>
>
You can apply:
[System.Security.SuppressUnmanagedCodeSecurity]
in order to suppress a security walk when calling into COM (or unmanaged
code) , note that this is not relevant when calling into .NET as unmanaged
code knows nothing about code access security.
Array's are always copied when calling into .NET from COM, see your other
thread for a more detailed answer.
Willy.
.
- References:
- Is it posible to create COM in .Net C#
- From: chinthamani
- Re: Is it posible to create COM in .Net C#
- From: apm
- Is it posible to create COM in .Net C#
- Prev by Date: DataRow getchange for a specific field
- Next by Date: how to add Guid in Primary Key automatically, in "Replication ID" field size type?
- Previous by thread: Re: Is it posible to create COM in .Net C#
- Next by thread: Re: ANN: Future of .NET
- Index(es):
Relevant Pages
|