Re: EnumChildWindows and C++
Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance
"Kevin Cochran" <KevinCochran@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:BF3E7350-25E8-4DD1-96BD-4C1C531B4580@xxxxxxxxxxxxx
Greetings John,
Yep, making it static worked. Could you recommend a resource that will
explain in depth how to use static and non-static member functions in
C++? I only recently began switching to C++ from C, so any good
resources would be appreciated.
Any C++ textbook should do it. A good one that is available both as a free
download and as a non-free printed book is Bruce Eckel: Thinking in C++.
http://mindview.net/Books/TICPP/ThinkingInCPP2e.html
The EnumChildWindows function is designed to take a C-style non-member
callback function. Generally a *public* static member function can be used
whereever a C-style non-member function can be used.
Compared to a non-member function, a static member function has two
properties:
1. It has access rights to public, protected and private members of the
class to which it belongs in the same way that a non-member "friend"
function does.
2. It can itself be public, protected or private.
What distinguishes a static member from a non-static member is that a static
member is not tied to an object of the class. To illustrate, suppose we have
a class X. We may define an object of class X as:
X x;
We can then call an ordinary member function:
x.ordinary_member();
ordinary_member() has an implicit argument, which is the "this" pointer of
x. The effect of this is that x's data members are "in scope" within the
definition of ordinary_member.
We can also call
x.static_member();
but static_member() does not have an implicit "this" pointer argument (this
absence of a hidden argument makes it like a non-member function, which is
why it is can be used in place of a non-member function in most contexts).
For static_member() to be able to refer to x's data members, it must take a
pointer/reference to x as an argument, e.g.,
x.static_member(&x);
Again, this is what you would do with a non-member function.
A static member can also be called with an alternative syntax:
X::static_member();
This means that, as with a non-member function, you can call a static member
without having an object of the class to bind it to (you can of course only
call it if the static member function is public or it is being called from a
function with the necessary access rights --- e.g., a friend function).
--
John Carson
.
Relevant Pages
- RE: Granting access via security group (user object vs. computer objec
... The TGT contaions the Encryped SIDs of the groups that user is a member of ... that allows us to provide security at the group level (if you allow the ... group to access the resource the members will also be allowed) ... is running using the local system account so I added that computer object as ... (microsoft.public.windows.server.active_directory) - Re: Authentication Mechanism Assurance
... How abt an explict Deny for a normal domain group of which Tom is a member ... So when tom logs in using smart card will he be able to access the resource? ... that was issued from a certificate issuance policy named Top Secret. ... (microsoft.public.windows.server.active_directory) - Authentication Mechanism Assurance
... With Auth Mech Assurance enabled, what if a users Certificate Linked Group ... domain group which is restricted access to the same resource. ... UserA - Member of: Auth Mech Assurange Group ... Permissions - Modify permissions to Auth Mech Assurance group ... (microsoft.public.windows.server.active_directory) - SIDHistory and kerberos max token size
... kerberos max token size on the client had to be modified ... because each user is a member of almost 1000 groups. ... Some of sites this current domain services are remote where the resource ... server is also the domain controller. ... (microsoft.public.windows.server.migration) - Re: Nesting Groups (Catch 22)
... Member permissions can be assigned only within the same domain as the parent domain local group. ... all the Intranet users and Corporate Forest is trusted by resource domain on ... resources that are member of the "Resource Forest/Domain". ... One instance of Sharepoint under XYZ and another one part of ABC. ... (microsoft.public.windows.server.active_directory) |
|