Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3670
Number of posts: 9122

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Common control initialization... Posted by Sephiroth on 2 Mar 2009 at 2:17 PM
I'm going to be using some common controls in my Windowing library and have a question about initializing the common controls. I know that I must call "InitCommonControlsEx()" prior to using them and I know that calling the function multiple times with different types of common controls stacks, and all of the controls become available, but what if I call it twice and use the same common control type? I have a base class that will initialize the common controls when an instance of said class is created. However, multiple types of control classes are sub-classes of this base class, such as a tab control or a progress bar.

Now assume I have an application that creates two instances of tab controls. This means that "InitCommonControlsEx()" was called to initialize the tab control type (WC_TABCONTROL) twice. Will this cause a problem? Since each class will be its own unique instance, I cannot set a simple boolean flag that says whether or not the common controls have been initialized since the multiple control classes would all have to know about each other and check with themselves every time a class is instantiated.

I did have an idea however, but am not sure it would work. I know that if I have a static method in one class, all instances of said class will share that method. If I declare a boolean variable static in my base class, will every sub-class have access to that one variable, or will each sub-class have its own unique copy?

-Sephiroth



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.