DCSIMG
מכללת הי-טק,COM - Pavel's Blog
Sign in | Join | Help

Pavel's Blog

Pavel is a software guy that is interested in almost everything
software related... way too much for too little time

Browse by Tags

ROT Object Invisible When Hosted in a Service
11 November 08 11:23 AM | pavely | with no comments
This will not interest any .NET developers… One of my customers wanted to create a system-wide singleton COM object hosted in a Windows service. However, the object implementation must be in a DLL. The service should start and create an instance of the object and make it available from other client processes. A simple approach would be to use the RegisterActiveObject function to register that instance as the class moniker of its kind. A client can get a proxy to the same instance by using GetActiveObject...
Writing a .NET Profiler
20 May 08 09:36 AM | pavely | 2 comment(s)
I was recently asked how a managed application can know the actual size of managed objects it allocates. Although there exists a Marshal.SizeOf method that seemingly can do the trick, this only works for value types, as the method is intended to be used in interop scenarios where some unmanaged memory must be allocated in managed code and passed to some unmanaged function. This question, and others like it can best be answered by using a the .NET profiling API. The .NET profiling API allows the ...
.NET, COM and Apartments Tips
21 February 08 06:18 PM | pavely | 2 comment(s)
We all know that when we use COM interop with .NET we get some RCW (Runtime Callable Wrapper) CLR object representing and controlling access to the underlying COM object. When we call the C# new operator, under the hood the RCW calls the CoCreateInstance API to create the actual COM object, etc. What may not be apparent, is that there may exist another proxy to the COM object, even if the COM server is a DLL (in-process server). The reason this may happen is related to COM apartments. an Apartment...