Re: WIN API example in C++
- From: "Thorsten Albers" <albersRE@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 26 Apr 2005 08:18:19 -0700
Wayne <wayne_r@xxxxxxxxxxx> schrieb im Beitrag
<OcTLU1mSFHA.3088@xxxxxxxxxxxxxxxxxxxx>...
> I'm sorry to hear that!
> So neither of us knows?
a)
A very short introduction to the Visual Basic Declare statement:
Declare Function OSRegOpenKey _
Lib "advapi32" _
Alias "RegOpenKeyA" _
( _
ByVal hKey As Long, _
ByVal lpszSubKey As String, _
phkResult As Long _
) As Long
- "Declare" introduces the respective external function to the VB project
- "Function '...'" specifies that the respective external function '...'
will return a value
- "Lib '...'" names the library which provides the external function
(filename extensions like ".DLL" etc. are optional)
- "Alias '...'" gives the name of the external function by which it is
exported from the respective library (only needed if differemt from the
name given after 'Function')
- "(" and ")" hold the external function's parameters
- "ByVal" specifies that the respective parameter will be passed to the
external function as a value ("ByRef" (optional) specifies that a pointer
to the value will be passed)
- "As Long" specifies the VB data type "Long" as the data type of the
respective parameter
- "As String" specifies the VB data type "String" as the data type of the
respective parameter
- "(...) As Long" specifies the VB data type "Long" as the return value's
data type
The only thing that you need to now about this to use OSRegOpenKey() in C++
is
- that the name of the external function is not "OSRegOpenKey" but
"RegOpenKeyA",
- that the trailing "A" is just a suffix indicating that "RegOpenKeyA" is
the ANSI version of "RegOpenKey" and
- that the function RegOpenKeyA() is provided by the library ADVAPi32.DLL".
Although I haven't done this I am almost sure that Google will provide you
with hundreds of sample codes in C/C++ for RegOpenKey().
b) It is really ridiculous to ask participants in a Visual Basic newsgroup
to provide you with C++ code!! There are really enough C/C++ related
newsgroups on the web, and you can be sure that in at least one of these
newsgroups there is at least one person who knows RegOpenKey(A) and is able
to provide you with sample code.
--
----------------------------------------------------------------------
THORSTEN ALBERS Universität Freiburg
albers@
uni-freiburg.de
----------------------------------------------------------------------
.
- Follow-Ups:
- Re: WIN API example in C++
- From: Wayne
- Re: WIN API example in C++
- References:
- WIN API example in C++
- From: Microsoft News
- Re: WIN API example in C++
- From: Thorsten Albers
- Re: WIN API example in C++
- From: Microsoft News
- Re: WIN API example in C++
- From: Thorsten Albers
- Re: WIN API example in C++
- From: Wayne
- WIN API example in C++
- Prev by Date: Re: SetProp & Atom
- Next by Date: Re: SetProp & Atom
- Previous by thread: Re: WIN API example in C++
- Next by thread: Re: WIN API example in C++
- Index(es):
Relevant Pages
|