By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,556 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,556 IT Pros & Developers. It's quick & easy.

What "0&" means in vb?

P: n/a
Hello
What "0&" means in this function call?
ret = InternetQueryOption(0&, INTERNET_OPTION_CONNECTED_STATE, _
ci, ci_len)
Thanks
Milan

Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
VB6 shorthand - means 0 is of type Long (32 bit)

"MilanB" <Mi****@discussions.microsoft.com> wrote in message
news:27**********************************@microsof t.com...
Hello
What "0&" means in this function call?
ret = InternetQueryOption(0&, INTERNET_OPTION_CONNECTED_STATE, _
ci, ci_len)
Thanks
Milan

Nov 21 '05 #2

P: n/a
Thanks
Nov 21 '05 #3

P: n/a
"MilanB" <Mi****@discussions.microsoft.com> schrieb:
[...]


In your sample ('InternetQueryOption') you should remove the '&' character.
The type of the first parameter is 'IntPtr', and you can pass 'IntPtr.Zero'
to the function.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

P: n/a
Thanks
Nov 21 '05 #5

P: n/a
I wouldn't use IntPtr.Zero, but convert it to an Integer because all the
first parameter is is a handle in which to query

Crouchie1998
BA (HONS) MCP MCSE
Nov 21 '05 #6

P: n/a
"Crouchie1998" <cr**********@spamcop.net> schrieb:
I wouldn't use IntPtr.Zero, but convert it to an Integer because all the
first parameter is is a handle in which to query


I'd change the type of the 'hInternet' parameter to 'IntPtr' and use
'IntPtr.Zero' instead of 0. Handles are typically declared as 'IntPtr'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.