Using Platform Invoke

  • Thread starter Thread starter Mircea Pleteriu
  • Start date Start date
M

Mircea Pleteriu

Hi all,

I need to call an Win32 API function within the c# code.
The function is InternetOpen.

One of the arguments of the function is of type DWORD, so it can be
tranlated to sn Int32 but the values it can take are
covered by API constant values.

The possible values the argument can take are:

INTERNET_OPEN_TYPE_DIRECT Resolves all host names locally.
INTERNET_OPEN_TYPE_PRECONFIG Retrieves the proxy or direct
configuration from the registry.
INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY Retrieves the proxy or
direct configuration from the registry and prevents the use of a startup
Microsoft JScript or Internet Setup (INS) file.
INTERNET_OPEN_TYPE_PROXY


How could I find out which value is associated to which canstant?

Thanks,
 
Mircea,
How could I find out which value is associated to which canstant?

You look in the appropriate Platform SDK header file, in this case
Wininet.h:

#define INTERNET_OPEN_TYPE_PRECONFIG 0
#define INTERNET_OPEN_TYPE_DIRECT 1
#define INTERNET_OPEN_TYPE_PROXY 3
#define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4



Mattias
 
Back
Top