Board index » cppbuilder » Problem using a Form from a DLL

Problem using a Form from a DLL


2005-04-27 08:32:54 PM
cppbuilder13
I have a DLL which constructs a form with a ListView component. This DLL is
called by an app which runs a process and the DLL updates the ListView when
errors occur.
Some very strange behaviour occurs with the underlying app which calls the
DLL. You can move the underlying app Window but as soon as you click on the
DLL form they both appear to be gridlocked together and neither froms can be
activated, moved or resized etc.
I have tried changing FormStyle from fsNormal to fsStayOnTop but no
difference.
Have I missed something ?
Thanks in advance
David
 
 

Re:Problem using a Form from a DLL

Hello,
I am sorry I cannot help you with your problem but perhaps you can help me.
I have a form I like to use in a DLL but I cannot create the form!
I cannot use new because I do not have a TComponent* to give to the
constructor.
I have also tried
Application->CreateForm(__classid(TIntTabDisp), &IntTabDisp);
but that gives me an "Access violation in RTL60.BPL" but the form is
displayed and works as it should!?
How do you create the form inside your DLL?
Regards
Ivar S.
"David" < XXXX@XXXXX.COM >skrev i meddelandet
Quote
I have a DLL which constructs a form with a ListView component. This DLL is
called by an app which runs a process and the DLL updates the ListView
when
errors occur.

Some very strange behaviour occurs with the underlying app which calls the
DLL. You can move the underlying app Window but as soon as you click on
the
DLL form they both appear to be gridlocked together and neither froms can
be
activated, moved or resized etc.

I have tried changing FormStyle from fsNormal to fsStayOnTop but no
difference.

Have I missed something ?

Thanks in advance
David


 

Re:Problem using a Form from a DLL

XXXX@XXXXX.COM wrote:
Quote
I have a form I like to use in a DLL but I cannot create the form!
I cannot use new because I do not have a TComponent* to give to the
constructor.
Why not ? You can supply a NULL too. Or Application->MainForm.
Quote
How do you create the form inside your DLL?
Usually you would have a function in that DLL that would create
the form.
Hans.
 

{smallsort}

Re:Problem using a Form from a DLL

How do you create the form inside your DLL?
example
TMyForm *Form = new TMyForm(NULL);
don't forget to delete it when finished.
You also have to enable "Build with runtime packages" option in the Packages
tab of the Project Options DBox.
regards
david
< XXXX@XXXXX.COM >wrote in message news:426ff97c$ XXXX@XXXXX.COM ...
Quote
Hello,

I am sorry I cannot help you with your problem but perhaps you can help
me.
I have a form I like to use in a DLL but I cannot create the form!
I cannot use new because I do not have a TComponent* to give to the
constructor.
I have also tried
Application->CreateForm(__classid(TIntTabDisp), &IntTabDisp);
but that gives me an "Access violation in RTL60.BPL" but the form is
displayed and works as it should!?

How do you create the form inside your DLL?

Regards
Ivar S.

"David" < XXXX@XXXXX.COM >skrev i meddelandet
news: XXXX@XXXXX.COM ...
>I have a DLL which constructs a form with a ListView component. This DLL
is
>called by an app which runs a process and the DLL updates the ListView
>when
>errors occur.
>
>Some very strange behaviour occurs with the underlying app which calls
the
>DLL. You can move the underlying app Window but as soon as you click on
>the
>DLL form they both appear to be gridlocked together and neither froms
can
>be
>activated, moved or resized etc.
>
>I have tried changing FormStyle from fsNormal to fsStayOnTop but no
>difference.
>
>Have I missed something ?
>
>Thanks in advance
>David
>
>


 

Re:Problem using a Form from a DLL

Thank you.
I had tried TMyForm *Form = new TMyForm(NULL); but it did not work with the
form I used.
With another form it does work.
/Ivar
"David" < XXXX@XXXXX.COM >skrev i meddelandet
Quote
How do you create the form inside your DLL?

example

TMyForm *Form = new TMyForm(NULL);

don't forget to delete it when finished.

You also have to enable "Build with runtime packages" option in the
Packages
tab of the Project Options DBox.

regards
david


< XXXX@XXXXX.COM >wrote in message
news:426ff97c$ XXXX@XXXXX.COM ...
>Hello,
>
>I am sorry I cannot help you with your problem but perhaps you can help
me.
>I have a form I like to use in a DLL but I cannot create the form!
>I cannot use new because I do not have a TComponent* to give to the
>constructor.
>I have also tried
>Application->CreateForm(__classid(TIntTabDisp), &IntTabDisp);
>but that gives me an "Access violation in RTL60.BPL" but the form is
>displayed and works as it should!?
>
>How do you create the form inside your DLL?
>
>Regards
>Ivar S.
>
>"David" < XXXX@XXXXX.COM >skrev i meddelandet
>news: XXXX@XXXXX.COM ...
>>I have a DLL which constructs a form with a ListView component. This DLL
is
>>called by an app which runs a process and the DLL updates the ListView
>>when
>>errors occur.
>>
>>Some very strange behaviour occurs with the underlying app which calls
the
>>DLL. You can move the underlying app Window but as soon as you click on
>>the
>>DLL form they both appear to be gridlocked together and neither froms
can
>>be
>>activated, moved or resized etc.
>>
>>I have tried changing FormStyle from fsNormal to fsStayOnTop but no
>>difference.
>>
>>Have I missed something ?
>>
>>Thanks in advance
>>David
>>
>>
>
>