Click to return to the Networking, Protocols     
Error Messages     Microsoft Win32 Internet ...     Microsoft Win32 Internet ...    
Web Workshop  |  Networking, Protocols & Data Formats

Win32 Internet Functions Syntax


Many of the Microsoft® Win32® Internet functions and structures have wrappers to provide Unicode support. To accommodate both ANSI and Unicode syntax in the header file and syntax sections of the reference, special notations are used to note where the syntax varies between implementations.

The areas where the syntax differs between the ANSI and Unicode implementations are:

The functions or structures that have both ANSI and Unicode support have a note in the information section of their reference pages. When your application is compiled, the function (or structure) will be substituted with the appropriate version ("A" version for ANSI or "W" version for Unicode).

The string parameter types for functions that have both ANSI and Unicode support are designated as LPCTSTR or LPTSTR. When your application is compiled, the LPCTSTR will be changed to LPCSTR (for ANSI) or LPCWSTR (for Unicode). LPTSTR will be changed to LPSTR (for ANSI) and LPWSTR (for Unicode).

Some buffer parameter types are defined as LPHACK, which is changed to LPCWSTR (for Unicode) or LPBYTE (for ANSI).

For example, here is the syntax for the InternetOpen function that is found in the reference:

HINTERNET InternetOpen(
    IN LPCTSTR lpszAgent,
    IN DWORD dwAccessType,
    IN LPCTSTR lpszProxy,
    IN LPCTSTR lpszProxyBypass,
    IN DWORD dwFlags
);

Here is the syntax for the ANSI version of the InternetOpen function:

HINTERNET InternetOpenA(
    IN LPCSTR lpszAgent,
    IN DWORD dwAccessType,
    IN LPCSTR lpszProxy,
    IN LPCSTR lpszProxyBypass,
    IN DWORD dwFlags
);

Here is the syntax for the Unicode version of the InternetOpen function:

HINTERNET InternetOpenW(
    IN LPCWSTR pszAgentW,
    IN DWORD dwAccessType,
    IN LPCWSTR pszProxyW,
    IN LPCWSTR pszProxyBypassW,
    IN DWORD dwFlags
);


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

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