|
-
May 23rd, 2000, 07:33 PM
#1
Thread Starter
New Member
Hi there!
Are API constants to be used in the same format like the one seen below?
Public Const ERROR_SUCCESS = 0&
Public Const HKEY_DYN_DATA = &H80000006
Can I give a different name to the constant?
Well I could understand some of the functions. But where can I find the whole API constants?
why '&' is used in almost all the declarations?
Please help.
Thanx,
Calm Indian.
-
May 23rd, 2000, 10:04 PM
#2
The & means that it's a hexidecimal value. You can get a lot of other info on APIs by clicking the VB API link at the left.
-
May 24th, 2000, 03:30 AM
#3
Here's another way to find API Constants. Open your API Text Viewer and select the file Win32api.txt. At the top CombBox where it says "Declares", switch it to Constants and a list should come up.
-
May 24th, 2000, 03:57 AM
#4
transcendental analytic
& means string addition and long integer, not hex. The hex is &H and a hexvalue following it. You could get the decimal value from hex by throwing it into immediate window and put a ? before it and press enter.
No you do not have to use hexvalues if you don't want to. If you feel more comfortable with dec values, then just do as i said and replace them.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 24th, 2000, 04:10 AM
#5
I made a couple of mistakes in my original reply to you. When I said that the & meant hexidecimal I meant to say &H as in the HKEY_DYN_DATA value. I also overlooked that you also asked about ERROR_SUCCESS which as kedaman correctly points out is defined as a Long via the &. I'm not sure however that he is right when he implies that you can use use decimal values in the place of hex values in API calls. All I know is that API calls, especially under NT, are very sensitive to the expected data type.
-
May 24th, 2000, 09:08 AM
#6
Addicted Member
Well answering the original question by INDIAN.
"Can I give a different name to the constant?"
YES ! you can... but you can also call a donkey a cat,
a goat a rat and so on... Then there will be no standard on who should call which donkey as what ?
To avoid all this, there is a standard way of naming windows
api constants. And this is used in win32 programming ..whether u chose to do that in vb or c++ or in MASM.
If you can't pronounce my name, call me GURU 
-
May 24th, 2000, 11:03 AM
#7
Thread Starter
New Member
Thanks...
Thanks a lot guys!!!

Calm Indian.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|