Click here to Skip to main content
15,892,809 members
Articles / Programming Languages / C#

Handling Unmanaged Memory Pointers in Managed Memory

Rate me:
Please Sign up or sign in to vote.
4.25/5 (19 votes)
19 Dec 2005CPOL6 min read 120.5K   1K   43  
This article shows some examples of using pointers from unmanaged-memory libraries in managed code (C#)
__declspec(dllexport) typedef struct DataRecord
{
	int RecordBufferSize;
	int NumberOfFields;
	int NumberOfElements;
	int RecordType;
	UINT RecordInfoFlags;
	char* FieldDescription;
} DataRecord, *PDataRecord;

__declspec(dllexport) typedef struct DataVariable
{
	char InternalName[16];
	char Mnemonic[4];
	char CurveLabel[26];
	USHORT Format;
	union
	{
		USHORT NumberOfBytes;
		USHORT NumberOfElements;
	};
	USHORT UnitType;
	USHORT SpecialHandling;
	SHORT NumberOfDecimalPlaces;
	USHORT OffsetInRecord;
} DataVariable, *PDataVariable;

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions