473,320 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Using Platform Invoke

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,
Nov 22 '05 #1
1 1445
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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lady_A | last post by:
Hi, I would like to use one of the error codes defined in WinError.h. There is no iclude anymore. I have put in "using System.Runtime.InteropServices" and the compiler still doesn't recognize...
2
by: Dov P | last post by:
hello everyone, i need to use api function named RegSetKeySecurity in my C# program. This function require ADVAPI32.DLL, but i cannot add this reference. I tried to use Microsoft.Win32.Registry...
3
by: Lady_A | last post by:
Hi, I would like to use one of the error codes defined in WinError.h. There is no iclude anymore. I have put in "using System.Runtime.InteropServices" and the compiler still doesn't recognize...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
10
by: Neville Lang | last post by:
Hi all, Here is a problem I first struck a while back in the Compact Framework. I am now using the full Framework (v2.0) and wanted to know whether there is anyway around this issue without...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.