//
archives

Archive for

Using a VT_RECORD VARIANT in Managed Code Part 3

1. Introduction. 1.1 Starting from this installment (part 3) of this series of articles, I shall be using the VariantStructGeneric structure (first defined in Defining a VARIANT Structure in Managed Code Part 2) to demonstrate how to work with VT_RECORD VARIANTs in managed code. 1.2 The VariantStructGeneric structure is a complete replica of the unmanaged … Continue reading

Using a VT_RECORD VARIANT in Managed Code Part 2

1. Introduction. 1.1 In part 1, I passed a native VT_RECORD VARIANT from managed code to unmanaged code. The VARIANT demonstrated in the example code of part 1 was created directly using code (Marshal.AllocHGlobal() and Marshal.GetNativeVariantForObject()). 1.2 Here in part 2, I shall demonstrate a very simple, albeit indirect, way to pass a VT_RECORD VARIANT from managed code … Continue reading

Using a VT_RECORD VARIANT in Managed Code Part 1

1. Introduction. 1.1 I have previously expounded in-depth on the usage of VARIANTs in managed code (please see the Using VARIANTs in Managed Code series of articles). 1.2 I have decided to dedicate a special series on VARIANTs that contain User-Defined Types (UDTs) because these deserve special attention. 1.3 VARIANTs that contain UDTs (also known as a VT_RECORD VARIANT), can be … Continue reading

Defining a VARIANT Structure in Managed Code Part 2

1. Introduction. 1.1 In part 1 of this series of blogs, I introduced the concept of the customized VARIANT structure defined completely in managed code. 1.2 However, we know that these customized structures will have limited re-usability. They are also non-interchangeable because they are completely different types. 1.3 What we need is a generic VARIANT structure that … Continue reading

Defining a VARIANT Structure in Managed Code Part 1

1. Introduction. 1.1 Not content with the 3 part “Using VARIANTs in Managed Code” write-up, I decided to start a new series of articles that expound further on the VARIANT structure. 1.2 This time, the goal is to study how we can represent a VARIANT structure in managed code. Along with this, various techniques for working with … Continue reading

Using VARIANTs in Managed Code Part 3

1. Introduction. 1.1 In part 1, we discussed how to receive native VARIANTs from unmanaged code. 1.2 In part 2, we explored techniques for passing a native VARIANT from managed code to unmanaged code. 1.3 Here in part 3, we shall study techniques for passing a native VARIANT (created from managed code) to unmanaged code by … Continue reading

Using VARIANTs in Managed Code Part 2

1. Introduction. 1.1 In part 1, we discussed how to receive native VARIANTs from unmanaged code. 1.2 Here in part 2, we will explore techniques for passing a native VARIANT from managed code to unmanaged code. 1.3 Both low- and high-level techniques will be studied. We shall also peer down into the low-level activities of … Continue reading

Using VARIANTs in Managed Code Part 1

1. Introduction. 1.1 The VARIANT type is a commonly used structure in unmanaged COM development. 1.2 A VARIANT is meant to be a generic container of a wide variety of COM types (in fact, every type recognized in the sub-set of the COM sub-system known as OLE automation). 1.3 Its counterpart in the managed world is … Continue reading