ITcTypeSystem2::CreateAlignedDataType

Creates a temporary type or a temporary data type derived from a DataArea, and then attempts to align it to the specified byte boundary. The result of the alignment check is indicated via pIsAligned. The method returns the generated type even if the alignment fails, as long as the parsing and generation themselves were successful.

Signature

HRESULT CreateAlignedDataType(BSTR xml, LONG alignmentSizeInBytes, ITcTypeInstance2** pipType, BSTR* pErrorMessage, VARIANT_BOOL* pIsAligned);

Parameter

Name

Type

Description

xml

BSTR

[in] XML with a temporary type or DataArea definition.

alignmentSizeInBytes

LONG

[in] Desired alignment size in bytes.

pipType

ITcTypeInstance2**

[out] Temporary type instance created.

pErrorMessage

BSTR*

[out] Error message from the alignment check, if one was generated.

Return value

Name

Type

Description

pIsAligned

VARIANT_BOOL*

[out, retval] VARIANT_TRUE if the generated type is aligned, otherwise VARIANT_FALSE.

(HRESULT)

HRESULT

S_OK if the type instance is successfully created; otherwise, an error code.

Error codes