Click here to Skip to main content
15,918,889 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: can I dynamically convert a base class object into a derived class object? Pin
toxcct18-Jan-06 23:32
toxcct18-Jan-06 23:32 
GeneralRe: can I dynamically convert a base class object into a derived class object? Pin
Stephen Hewitt18-Jan-06 23:17
Stephen Hewitt18-Jan-06 23:17 
GeneralRe: can I dynamically convert a base class object into a derived class object? Pin
Prakash Nadar18-Jan-06 23:19
Prakash Nadar18-Jan-06 23:19 
QuestionChild Static Control not displayed when created when parent hidden !? Why!! Pin
Axonn Echysttas18-Jan-06 18:55
Axonn Echysttas18-Jan-06 18:55 
AnswerRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Stephen Hewitt18-Jan-06 19:11
Stephen Hewitt18-Jan-06 19:11 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Axonn Echysttas18-Jan-06 19:56
Axonn Echysttas18-Jan-06 19:56 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Stephen Hewitt18-Jan-06 20:00
Stephen Hewitt18-Jan-06 20:00 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Axonn Echysttas18-Jan-06 20:28
Axonn Echysttas18-Jan-06 20:28 
Thanks for answering by the way :- ). Yes, I know what WS_VISIBLE does. The code is quite big and has some other functions. I will try to keep it down as much as possible not to clog the post.

1. Window is created via a call to a Build function. The Build function creates the PARENT like this:

hwndThis = CreateWindowEx<br />
(<br />
	NULL,<br />
	sClassName, //Was previously registered via RegisterClassEx. Very standard.<br />
	sClassName,<br />
	WS_POPUP | WS_VISIBLE,<br />
	0,<br />
	0,<br />
	W, //Assume 100x100 window.<br />
	H,<br />
	NULL,<br />
	NULL,<br />
	hHost, //Some valid handle to another window (the one which called this code).<br />
	NULL<br />
);


2. The kid is created like this, using a call to a CreateControl function, AFTER the Build function finished its stuff:

<br />
hwndControl = CreateWindowEx //Creating the window.<br />
(<br />
	NULL,    //ExStyles.<br />
	"Static",    //Class name.<br />
	Text,    //Text of the label.<br />
	lStyle,    //Styles. =  WS_CHILD | WS_VISIBLE<br />
	0,    //X.<br />
	0,    //Y.<br />
	0,    //Width.<br />
	0,    //Height.<br />
	hwndThis,    //Parent, the one created before...<br />
	NULL,    //Menu.<br />
	(HINSTANCE)hwndThis,    //Parent, the one created before.<br />
	NULL    //CreateStruct.<br />
);


The conclusion is that I don't see the kid displayed. At all.

However, if I call the CreateControl function when clicking some other button, it works. What doesn't work is when in the same place I do

Build
CreateControl

But if I do:

Build
<now click="" some="" button="">
CreateControl <in the="" code="" of="" that="" button="">

It works.

-= E C H Y S T T A S =-
The Greater Mind Balance
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Stephen Hewitt18-Jan-06 20:57
Stephen Hewitt18-Jan-06 20:57 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Axonn Echysttas18-Jan-06 21:22
Axonn Echysttas18-Jan-06 21:22 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Stephen Hewitt18-Jan-06 21:44
Stephen Hewitt18-Jan-06 21:44 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Axonn Echysttas18-Jan-06 22:00
Axonn Echysttas18-Jan-06 22:00 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Stephen Hewitt18-Jan-06 22:03
Stephen Hewitt18-Jan-06 22:03 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Axonn Echysttas19-Jan-06 0:44
Axonn Echysttas19-Jan-06 0:44 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Axonn Echysttas19-Jan-06 1:07
Axonn Echysttas19-Jan-06 1:07 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Stephen Hewitt19-Jan-06 1:55
Stephen Hewitt19-Jan-06 1:55 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Axonn Echysttas19-Jan-06 2:23
Axonn Echysttas19-Jan-06 2:23 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Stephen Hewitt19-Jan-06 3:27
Stephen Hewitt19-Jan-06 3:27 
GeneralRe: Child Static Control not displayed when created when parent hidden !? Why!! Pin
Axonn Echysttas19-Jan-06 4:15
Axonn Echysttas19-Jan-06 4:15 
QuestionWPARAM and LPARAM ? Pin
Owner drawn18-Jan-06 17:50
Owner drawn18-Jan-06 17:50 
AnswerRe: WPARAM and LPARAM ? Pin
Prakash Nadar18-Jan-06 17:57
Prakash Nadar18-Jan-06 17:57 
AnswerRe: WPARAM and LPARAM ? Pin
Christian Graus18-Jan-06 17:58
protectorChristian Graus18-Jan-06 17:58 
QuestionRe: WPARAM and LPARAM ? (What about HWND...Where should it go?) Pin
Owner drawn18-Jan-06 18:02
Owner drawn18-Jan-06 18:02 
AnswerRe: WPARAM and LPARAM ? (What about HWND...Where should it go?) Pin
Prakash Nadar18-Jan-06 18:15
Prakash Nadar18-Jan-06 18:15 
AnswerRe: WPARAM and LPARAM ? Pin
Blake Miller19-Jan-06 8:02
Blake Miller19-Jan-06 8:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.