STRRET Structure Question
-
When uType is STRRET_OFFSET, MSDN doesn't say whether the string uOffset is pointing to is an ANSI or Unicode string. Is it always ANSI or always Unicode? Is it ANSI on Win9x systems and Unicode on WinNT systems? Thanks.
You shouldn't have to worry about that. Use one of the
StrRetTo*
functions in shlwapi.--Mike--
-
When uType is STRRET_OFFSET, MSDN doesn't say whether the string uOffset is pointing to is an ANSI or Unicode string. Is it always ANSI or always Unicode? Is it ANSI on Win9x systems and Unicode on WinNT systems? Thanks.
uOffset is declared as UINT (unsigned int). So it is not a string. The only string in the union is pOleStr and it is declared as LPWSTR (pointer to unicode string). ANSI or UNICODE is not dependent on the OS. It depends on whether the macro UNICODE or _UNICODE is declared or not. For example, LPTSTR (TCHAR*) becomes LPSTR (CHAR*) if UNICODE is not declared and LPWSTR (WCHAR*) if UNICODE is declared.
«_Superman_» I love work. It gives me something to do between weekends.
-
uOffset is declared as UINT (unsigned int). So it is not a string. The only string in the union is pOleStr and it is declared as LPWSTR (pointer to unicode string). ANSI or UNICODE is not dependent on the OS. It depends on whether the macro UNICODE or _UNICODE is declared or not. For example, LPTSTR (TCHAR*) becomes LPSTR (CHAR*) if UNICODE is not declared and LPWSTR (WCHAR*) if UNICODE is declared.
«_Superman_» I love work. It gives me something to do between weekends.
«_Superman_» wrote:
uOffset is declared as UINT (unsigned int). So it is not a string.
uOffset is an offset to a string. I was wondering whether the string it's "pointing" to was ANSI or Unicode.
«_Superman_» wrote:
ANSI or UNICODE is not dependent on the OS. It depends on whether the macro UNICODE or _UNICODE is declared or not. For example, LPTSTR (TCHAR*) becomes LPSTR (CHAR*) if UNICODE is not declared and LPWSTR (WCHAR*) if UNICODE is declared.
I know about the TCHAR stuff. The reason I mentioned the OS was because I was thinking since Win9x used ANSI internally (mostly, I think) and WinNT used Unicode (but supported programs compiled for ANSI for compatibilty), the string inside the PIDL where uOffset is "pointing" would be that type.
-
«_Superman_» wrote:
uOffset is declared as UINT (unsigned int). So it is not a string.
uOffset is an offset to a string. I was wondering whether the string it's "pointing" to was ANSI or Unicode.
«_Superman_» wrote:
ANSI or UNICODE is not dependent on the OS. It depends on whether the macro UNICODE or _UNICODE is declared or not. For example, LPTSTR (TCHAR*) becomes LPSTR (CHAR*) if UNICODE is not declared and LPWSTR (WCHAR*) if UNICODE is declared.
I know about the TCHAR stuff. The reason I mentioned the OS was because I was thinking since Win9x used ANSI internally (mostly, I think) and WinNT used Unicode (but supported programs compiled for ANSI for compatibilty), the string inside the PIDL where uOffset is "pointing" would be that type.
In that case, the string is a unicode string.
«_Superman_» I love work. It gives me something to do between weekends.
-
In that case, the string is a unicode string.
«_Superman_» I love work. It gives me something to do between weekends.