Link to home
Start Free TrialLog in
Avatar of suda5181
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?
Avatar of jkr
jkr
Flag of Germany image

You could

WINDOWPLACEMENT wp;

ZeroMemory((LPVOID)&wp, sizeof(WINDOWPLACEMENT));
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of suda5181
suda5181

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
Actually, the above should definitely work. Is this your exact code?
Sorry, its my mistake

thanks for the solution