Converting Assemblies to COM Type Libraries

The .NET SDK comes with two tools that can be used to generate type libraries from assemblies the Type Library Exporter (tlbexp.exe) and the Assembly Registration Tool (regasm.exe). The Type Library Exporter takes an assembly as input and produces the corresponding type library as output. The Assembly Registration Tool also produces a type library from a .NET assembly and registers the type library and its COM classes in the Windows Registry. Because we are concerned with more than just...

Deciding between MarshalByVal and MarshalByRef

If you are implementing ServicedComponent-derived classes, choosing between MarshalByRef and MarshalByVal is moot. Because ServicedComponent inherits from ContextBoundObject, you know that all of your COM components are marshaled by reference. But how do you decide which to use if other parts of your application need to be remoted without the help of ServicedComponent Let me give you some criteria to help make that decision. Objects whose complete state can be moved across the network with a...

Exception Handling

Although queued components provide a robust environment for distributed applications, problems can still arise. For example, a client may not have sufficient rights to send a message to a component's input queue. In other situations, a component may not be able to process a message that has reached its queue. The second scenario can be particularly nasty because it can lead to a poison message. To handle client errors and server-side errors, COM provides a way for you to specify an...

Developing MSMQ Applications by Using C

For years, developers have used MSMQ COM components or MSMQ API functions to develop applications that use message queuing. These APIs allow developers to read from queues, write to them, and perform management tasks such as creating them. The .NET Framework provides a similar set of APIs for the C developer. The System.Messaging namespace System.Messaging.dll contains all the classes, interfaces, and enumerations you need to develop .NET applications that take advantage of of MSMQ's features....