//
archives

Archive for

Tip for Managed Applications that use COM objects – Exposing Metadata For Your COM Objects Part 2

1. Introduction 1.1 This article is a continuation of a previous article in which I expounded on how metadata can be exposed to managed code for COM objects. 1.2 In that article, the COM object was created via ProgID through the use of the Type.GetTypeFromProgID() function followed by a call to Activator.CreateInstance(). 1.3 With a … Continue reading

Tip for Managed Applications that use COM objects – Exposing Metadata For Your COM Objects Part 1

1. Introduction. 1.1 If you have ever used COM objects in your managed applications, you would have certainly come across an intriguing  type named “System.__ComObject”. 1.2 This type indicates a generic Runtime-Callable Wrapper (RCW) that has no metadata available. It is also an internal class in the mscorlib assembly. It is not possible to define … Continue reading

How to Store Binary Data in a BSTR.

1. Introduction 1.1 A BSTR is flexible in the sense that not only can you store a character string in it, you can also store binary data. 1.2 This programming tip presents sample code which demonstrates how this can be done. 2. The SysAllocStringByteLen() API. 2.1 Normally, when you want to allocate a BSTR, you … Continue reading