Microsoft SDK for Java

ptrToStruct

This method of the ComLib Class maps a raw pointer onto a structure. This method simulates a C-style cast of an arbitrary pointer to a structure.

Syntax

public static native Object ptrToStruct(Class structClass, int ptr, boolean fFreeIndirectNativeMemory);

Return Value

Returns an instance of structClass.

Parameters

structClass The structure to map the raw pointer to. This class must have been declared using @com.struct.
ptr The raw pointer to be mapped.
fFreeIndirectNativeMemory If true, the native memory used for any reference fields (strings, interfaces, and so on) are released appropriately.

Remarks

This method was added as of versions 2925 through 3167 of the Microsoft virtual machine.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.