//
archives

Marshal.PtrToStringUni

This tag is associated with 3 posts

Writing to Data Exported From a DLL in Managed Code.

1. Introduction. 1.1 This article is a direct follow-up from my last blog entry Accessing Exported Data From a DLL in Managed Code in which I expounded on the basic principles behind how to access data items exported from a DLL. 1.2 In that article, I wrote that besides being able to read them, it is … Continue reading

Using the StringBuilder in Unmanaged API Calls.

1. Introduction. 1.1 I have written extensively about passing strings to and from unmanaged APIs. Most notably Returning Strings from a C++ API to C#. 1.2 The managed type that I have used throughout these articles have been the string. 1.3 When working with unmanaged APIs the DllImport declarations of which take a string as parameter, one of … Continue reading

Returning Strings from a C++ API to C#

1. Introduction. 1.1 APIs that return strings are very common. However, the internal nature of such APIs, as well as the use of such APIs in managed code, require special attention. This blog will demonstrate both concerns. 1.2 I will present several techniques for returning an unmanaged string to managed code. But before that I shall first provide an … Continue reading