tags:

views:

32

answers:

2

According to the MSDN, you can specify an access type parameter to InternetOpen. Two of the options for the dwAccessType parameter are:

INTERNET_OPEN_TYPE_DIRECT - Resolves all host names locally. INTERNET_OPEN_TYPE_PRECONFIG - Retrieves the proxy or direct configuration from the registry.

Which of these should I use? I don't know which would be "better". We don't want our application to do anything clever, all we want it to do is access the internet in a normal way.

+1  A: 

INTERNET_OPEN_TYPE_PRECONFIG is what you normally want. INTERNET_OPEN_TYPE_DIRECT means it should bypass any proxy that is configured. It can be useful for things like some trouble shooting, but it's ignoring how the user has things configured, which is rarely a good idea.

Jerry Coffin
+1  A: 

I have always used INTERNET_OPEN_TYPE_PRECONFIG, and it has always worked perfectly. I believe this is also the "default" value (if one may say so), because INTERNET_OPEN_TYPE_PRECONFIG = 0.

Andreas Rejbrand