Instance_UnSerialize function

Applies To: Implementing a custom GeoTransformer

Creates a custom GeoTransformer instance, initialized with identical content of a discarded instance. It reconstructs the state of the previously serialized object, including possible precomputed variables.

[C / C++]

extern "C" HGeoTrans __stdcall Instance_UnSerialize(

const char * szClass, // name of the custom GeoTransformer

const char * szVersion, // version of the serialized GeoTransformer

const LPVOID pBuffer, // serialization buffer

GeoTrans_CreationFlags dwFlags // creation flags specifying how it will be used

);

Arguments

[in] szClass

String describing the class attribute of the custom GeoTransformer. Refer to the documentation of Instance_Create function for details about the class attribute of a GeoTransformer Definition.

Note: It is not required to test the pointer against NULL, since GeoTransCore component ensures their validity.

[in] szVersion

String describing the version attribute of the custom GeoTransformer. Refer to the documentation of Instance_Create function for details about the version attribute of a GeoTransformer Definition.

Note: It is not required to test the pointer against NULL, since GeoTransCore component ensures their validity.

[in] pBuffer

The serialization buffer storing the binary representation of the GeoTransformer object that needs to be restored. See Instance_Serialize for details on its content.

Note: It is not required to test the pointer against NULL, since GeoTransCore component ensures their validity.

[in] dwFlags

A flag combination specifying which functionalities are required for the restored instance. Please see Instance_Create function for details about its possible values.

GeoTrans_CreationFlags type is defined in GeoTransCreation namespace as a DWORD.

Return Value

Must return NULL when the serialized GeoTransformer instance could not be reconstructed, else return the handle to the new instance being initialized with the same content as described by the given buffer. Please refer to the documentation of Instance_Create for details about a handle to a GeoTransformer, and how to set error / warning codes in order to report descriptions of the reasons for failure.

Remarks

It is not a requirement to support serialization, but it is highly recommended.

Versioning control: Do not reconstruct objects having an incompatible version. We encourage versioning control support for GeoTransformers, as described in the documentation of Instance_Create function.

Requirements

Platform

32 bit Windows OS

Environment

ANSI C / C++ Standard compliant

API

__stdcall calling convention; by name, undecorated "C" export

Unicode support

SBCS (ASCII) only

Example

For a basic example on how to implement this function, please see Custom GeoTransformer VC++ Sample.

Related Topics

See also: Instance_Create, Instance_Discard, Error_FormatMessage, Instance_Serialize, GeoTransCreation, GTM_Errors_Warnings