Board index » cppbuilder » Problem dynamically creating frames within a COM server

Problem dynamically creating frames within a COM server

Hi,

has anyone had problems dynamically creating frame objects within an in-process
COM server (i.e. a DLL).

I have some code inside a COM server which creates a form and displays it.
Later, it dynamically creates some frames and places these on the form.

This works fine in the executable, but when attempting to do the same in a DLL,
I get the following exception :-

Exception EInvalidOperation with message 'Control 'TestFrame' has no parent
window'
This only happens when certain controls exist on the frame, for example the
error occurs, if I place a TMemo component on the frame.

Does anyone know why this is happening ?

Thanks in advance.
Phil.

 

Re:Problem dynamically creating frames within a COM server


Sorry, never used TFrame, much less in a COM server.

.a

Quote
Phil Parker wrote:

[snip]

Re:Problem dynamically creating frames within a COM server


Turns out it was related to the global TApplication object in the DLL not having
a handle to the host applications main window.  I've temporarily fixed it so
that the client passes in the handle on startup to the server but it's a yucky
hack.

Alex, do you know if there's a better way of getting the host applications main
window handle ?

Phil.

On Mon, 25 Sep 2000 16:19:55 -0700, "Alex Bakaev [TeamB]" <al...@jetsuite.com>
wrote:

Quote
>Sorry, never used TFrame, much less in a COM server.

>.a

>Phil Parker wrote:
>[snip]

Re:Problem dynamically creating frames within a COM server


Phil, I'm pretty sure this was discussed a while ago. I suggest the vcl
groups...

.a

Quote
Phil Parker wrote:

[snip]

Other Threads