I think I've encountered a problem beyond my template metaprogramming skills... :)
Here's the deal: I need to choose a constructor (preferrablly at compile time) based upon an argument to my template.
class Example1
{
Example1(int a);
};
class Example2
{
Example2(int a, bool b);
};
typedef...
#define SHGVSPB_PERUSER 0x00000001 // must have one of PERUSER or ALLUSERS
#define SHGVSPB_ALLUSERS 0x00000002
#define SHGVSPB_PERFOLDER 0x00000004 // must have one of PERFOLDER ALLFOLDERS or INHERIT
#define SHGVSPB_ALLFOLDERS 0x00000008
#define SHGVSPB_INHERIT 0x00000010
#define...
That does not tell me the numeric value of, for example, SHGVSPB_PERUSER, which I need in order to make use of the function. Or were you just reposting the link to the framed version instead?
I am using Visual C++ 6.0.
I would like to use this function: SHGetViewStatePropertyBag
Unfortunately, my header files do not define this function. Does anyone know where I can find the constants for the dwFlags parameter?
template<class Type> void* MemberAddress(Type pFunction)
{
void* pFuncAddress;
__asm mov eax, pFunction
__asm mov pFuncAddress, eax
return pFuncAddress;
}
void* pAddress = MemberAddress(&Example::foo_member);
You may then call this as with any other function, simply passing a pointer to...
OK, yes. However, when all is said and done, the calling convention is actually (in this case) __cdecl with the addition of a 32-bit pointer to the beginning of the argument list. While this may not hold true on every platform, I'd bet that it holds true on most, and it certainly will hold true...
That is definitely an option, but one I was hoping to avoid. Before you posted, I'd already implemented this, and it works fine, but I'd still like to know why exactly I can't get the address of a member function, even a non-virtual one.
I am using a C-based library (sqlite) from my C++ program. This library includes a function which takes a pointer to a callback. I'd like to use a member function as the callback.
sqlite3_exec(sldbDatabase, "", &(this->AddFarmFromRow), this, &sError);
The first parameter passed to the callback...
Thanks, I'll look into it. I'm leaning more and more towards only supporting the current and default users, though... Anything more seems like a lot of work. :-(
I'm trying to figure out how to enumerate users on several versions of Windows--2000 and XP at the minimum. I've looked at NetEnumUsers, but this appears to only be for XP. I need to retrieve the user name and the registry key representing HKEY_CURRENT_USER. Any help would be appreciated... :)
Don't worry, I am fully prepared for any consequences: I have all my data backed up to CD, and disk images of my OS and programs--and I don't mind a reinstall if absolutely necessary. Now, I'll see if I can find some good warez sites and then check for the spyware I want... :)
XP SP2 has the ICF, which is enabled by default. You can double-check that it is enabled using this process:
http://www.microsoft.com/windowsxp/using/networking/learnmore/icf.mspx
This is sufficient to protect you against Blaster, Sasser, and similar worms, but I recommend getting a firewall...
This is also one excellent use for the ICF... It has worked fine on my installations of XP Pro and Home. Usually I disable it later and find something that watches outbound as well, though.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.