suda5181
asked on
Initializing WINDOWPLACEMENT structure
I am using the WINDOWPLACEMENT structure in several different places. I want to be able to initialize the members to NULL.
Can i only do this by accessing each individual member and setting them to NULL. Is there any other way or a better way i can acheive this?
Can i only do this by accessing each individual member and setting them to NULL. Is there any other way or a better way i can acheive this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the ZeroMemory function works fine, but when i try to initialize the windowplacememnt structure to NULL from the Constructor of another class, it does not work
it skips the instruction
class class1 : public CDocument
{
public :
bool flag;
WINDOWPLACEMENT wp;
}
class1::class1()
{
flag =false;
ZeroMemory((LPVOID)&wp, sizeof(WINDOWPLACEMENT));
wp.length = sizeof(WINDOWPLACEMENT);
}
Am i doing something wrong here ??
thanks
it skips the instruction
class class1 : public CDocument
{
public :
bool flag;
WINDOWPLACEMENT wp;
}
class1::class1()
{
flag =false;
ZeroMemory((LPVOID)&wp, sizeof(WINDOWPLACEMENT));
wp.length = sizeof(WINDOWPLACEMENT);
}
Am i doing something wrong here ??
thanks
Actually, the above should definitely work. Is this your exact code?
ASKER
Sorry, its my mistake
thanks for the solution
thanks for the solution
WINDOWPLACEMENT wp;
ZeroMemory((LPVOID)&wp, sizeof(WINDOWPLACEMENT));