Re: How to find those constants for a API Declare



simon wrote:
Hello all friends. I am a VB-API beginner. I want to know hoe to find
its constants for a API Declare. For example:
When we declare a function:
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias
"RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String,
phkResult As Long) As Long

Const ERROR_SUCCESS = 0&
Const ERROR_BADDB = 1009&
Const ERROR_BADKEY = 1010&
Const ERROR_CANTOPEN = 1011&
Const ERROR_CANTREAD = 1012&
Const ERROR_CANTWRITE = 1013&
Const ERROR_REGISTRY_RECOVERED = 1014&
Const ERROR_REGISTRY_CORRUPT = 1015&
Const ERROR_REGISTRY_IO_FAILED = 1016&
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002

The questions are:
1. Why we just make those constants in the code?
2. What is relevance with those constants and this API function?
3. How can I find which constants will be used in a API function?
4. I´ve heard that in the C++ head file (.h file) can be found this
relation, but I don´t know hoe to find it yet.
5. Do you have any tools to refer it? The VB API viewer can find those
Declares, but I can´t find each API will use which constants.

Waiting you answer.thank you!!

Best Regards.
Simon

Best tool I know of for finding which API uses what constants/parameters is
the API Guide available from http://www.allapi.net/

Hope this helps.

Best,
Bill


.



Relevant Pages

  • RE: Cannot get code to work for API Save Dialog Box
    ... You can put it in the same Standard module with DetectExcel: ... ' Declare necessary API routines: ... Declare Function FindWindow Lib "user32" Alias _ ... switch to the Excel sheet to see what happened. ...
    (microsoft.public.access.forms)
  • Re: How to find those constants for a API Declare
    ... its constants for a API Declare. ... Const ERROR_BADDB = 1009& ... What is relevance with those constants and this API function? ... Most of your questions can be answered by consulting the Platform SDK, ...
    (microsoft.public.vb.winapi)
  • Re: Problem with passing parameter
    ... Appending alias to API ... Declare Function WriteFile Lib "kernel32.dll" (ByVal hFile As Long, ... Public Sub WriteData(ByRef RecData As String) ...
    (microsoft.public.vb.general.discussion)
  • How to find those constants for a API Declare
    ... its constants for a API Declare. ... Const ERROR_BADDB = 1009& ... What is relevance with those constants and this API function? ... How can I find which constants will be used in a API function? ...
    (comp.lang.basic.visual.misc)
  • How to find those constants for a API Declare
    ... its constants for a API Declare. ... Const ERROR_BADDB = 1009& ... What is relevance with those constants and this API function? ... How can I find which constants will be used in a API function? ...
    (microsoft.public.vb.winapi)