[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

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?
0
suda5181
Asked:
suda5181
  • 3
  • 2
1 Solution
 
jkrCommented:
You could

WINDOWPLACEMENT wp;

ZeroMemory((LPVOID)&wp, sizeof(WINDOWPLACEMENT));
0
 
jkrCommented:
Oops, a little thing is missing:

WINDOWPLACEMENT wp;

ZeroMemory((LPVOID)&wp, sizeof(WINDOWPLACEMENT));

wp.length = sizeof(WINDOWPLACEMENT);
0
 
suda5181Author Commented:
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
0
 
jkrCommented:
Actually, the above should definitely work. Is this your exact code?
0
 
suda5181Author Commented:
Sorry, its my mistake

thanks for the solution
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now