Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages
Started by Steven Haworth
Wed, 31 Oct 2007 04:31
TFrame changes?
Author: Steven Haworth
Date: Wed, 31 Oct 2007 04:31
Date: Wed, 31 Oct 2007 04:31
29 lines
1956 bytes
1956 bytes
Hi,
I am upgrading my BCB2006 application to BCB2007 and I am having issues with
creating TFrame objects. If I define a TFrame descendant in my project that
contains a TWinControl derived control, then I always get the exception
Project xx.exe raised exception class EInvalidOperation with message
'Control 'Frame2' has no parent window'
whenever I try to create the frame at runtime; ie.
TFrame2 *f = new TFrame(this);
If the frame has just a label or something like that on it, then it wont
throw an exception.
This worked fine in BCB2006 but not now.
Unfortunately I cannot reproduce this in a fresh application (my application
was rebuilt by adding the units to a new project file) so it could be in
relation to a 3rd party library, but I don't know which one.
I have been searching everywhere and I know there is some information on the
changes in the codegear blogs, but they seem to be unsearchable, or there is
no information on frames.
Thanks for any help
Steve
Re: TFrame changes?
Author: ohmy
Date: Wed, 31 Oct 2007 09:23
Date: Wed, 31 Oct 2007 09:23
8 lines
1369 bytes
1369 bytes
I've seen the problem you describe before but unfortunately I can't remember how I solved it; but I think it was related to its Name property. So I don't know if this will help any, but before setting the frame's Parent, try setting its Name property to "". Or make sure the frame you edit in the IDE has its Name property filled in; it can't be empty there. I've had all kinds of weird problems with TFrames and their Name property.
Re: TFrame changes?
Author: Remy Lebeau (TeamB)
Date: Wed, 31 Oct 2007 18:26
Date: Wed, 31 Oct 2007 18:26
26 lines
2048 bytes
2048 bytes
"Steven Haworth" <SHaworthatbigponddotnetdotau> wrote in message news:4728052a@newsgroups.borland.com... > If I define a TFrame descendant in my project that contains a > TWinControl derived control, then I always get the exception > > Project xx.exe raised exception class EInvalidOperation with > message 'Control 'Frame2' has no parent window' That happens when you are trying to do something during creation that requires an HWND to be present, but no HWND can be created because the Parent has not been assigned yet. What are you actually doing inside the TFrame when it is being created? Have you tried stepping through the TFrame's construction code yet to see exactly where the exceptions is occuring? My guess is that you are trying to initialize the TWinControl with some data, so it tries to create its HWND, which requests the TFrame to create its HWND, which then fails. > If the frame has just a label or something like that on it, then it > wont throw an exception. TLabel is a graphical control. It does not have or need an HWND. Gambit
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads