Conversion Functions

The Wxutil.h header file in the Microsoft® DirectShow® base classes provides functions for converting between different data types (for example, between integers and wide strings) and between different stream formats.

atoi Converts a string to an integer.
ConvertVideoInfoToVideoInfo2 Converts a VIDEOINFO stream format to a VIDEOINFOHEADER2 format.
IntToWstr Converts an integer to a wide string.
WstrToInt Converts a wide string to an integer.

atoi

Conversion Functions

Converts a given string to an integer.

Syntax

int WINAPI atoi(
    const TCHAR *sz
    );

Parameters

sz
Pointer to a source character string.

Return Value

Returns the string's integer value.

Remarks

This version of atoi supports only decimal digits, and does not allow leading white space or signs. It supports both Unicode™ and ANSI strings. Other versions can vary.

ConvertVideoInfoToVideoInfo2

Conversion Functions

Converts a VIDEOINFO stream format to a VIDEOINFOHEADER2 format.

Syntax

STDAPI ConvertVideoInfoToVideoInfo2(
    AM_MEDIA_TYPE *pmt
    );

Parameters

pmt
[in/out] Pointer to the AM_MEDIA_TYPE enumerated type.

Return Value

Returns an HRESULT value that depends on the implementation of the interface. HRESULT can include one of the following standard constants, or other values not listed.

E_OUTOFMEMORY Operation ran out of memory.
S_OK Success.

Remarks

If successful, this function modifies the formattype member of AM_MEDIA_TYPE to change its registered GUID from a VIDEOINFO type to a VIDEOINFOHEADER2 type.

IntToWstr

Conversion Functions

Converts a given integer value to a wide string representation.

Syntax

void IntToWstr(
    int i,
    LPWSTR wstrDest
    );

Parameters

i
Integer value to be converted.
wstrDest
Pointer to the LPWSTR that will contain the resulting wide string.

Return Value

No return value.

WstrToInt

Conversion Functions

Converts a given wide string value to an integer.

Syntax

int WstrToInt(
    LPCWSTR wstrSrc
    );

Parameters

wstrSrc
Pointer to the source wide-character string.

Return Value

Returns the string's integer value.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.