PDA

Click to See Complete Forum and Search --> : DLL's and Forms


manofprayer
Mar 14th, 2001, 01:11 AM
Is it wise to use ActiveX DLL's to store information of a GUI? What I mean is, is it OK to store Forms in a DLL file and open them through methods?

If not, how about in Active X EXE's?

If still no, what would be the best way to store GUI's modularly so that when I want to update it, I do not have to change the whole thing?

thank you

simonm
Mar 14th, 2001, 07:56 AM
I display forms in ActiveX DLL's all the time and don't have any problems.

What exactly are you concerned about?

manofprayer
Mar 14th, 2001, 06:15 PM
I get this error.

Title: Component Request Pending

An action cannot be completed because a component (whatever the DLL) is not responding. Choose "Switch To" to activate the component and correct the problem.

this is the code:

-> the DLL (Test.DLL)

' in the DLL, I have a form (Form1) and a class module (Module1)

'Form1
'I have 1 command button for Form1

Private Sub Command1_Click
msgBox ("Hello World")
End Sub

'Module1
Public Sub Show
Form1.Show
End Sub

-> the EXE Project

'I have 1 form ProjForm and 1 command button CommandProj

Private Sub CommandProj_Click
Dim Message As New Test.Module1
Message.Show
End Sub

Please help if you could.

* thanks *

bhaskerg
Mar 14th, 2001, 10:42 PM
manofprayer are u sure that u'r dll has been really converted to a file with the extension .dll ?...since sometimes it'll go for "make project" and even though u can refer it from a client form u'll get the error u have mentioned...so try again to convert it into dll and refer it again in the client side...all the best.

simonm
Mar 15th, 2001, 01:10 AM
In your DLL you should instantiate Form1 rather than just showing it. Also, try showing it modally.

i.e.

Dim frm As Form1

Set frm = New Form1

frm.Show vbModal

bhaskerg
Mar 15th, 2001, 01:52 AM
There is no need for instancing the form since i tried the exact code of manofprayer and is working fine!!

simonm
Mar 15th, 2001, 02:02 AM
It's always a good idea to instantiate your forms so you always know when you use a form whether it is a new instance or a previously existing instance.

manofprayer,

Does your form eventually get displayed (even if you have to click on 'Switch To'? I only ask as there is a timeout setting which dictates how long a project waits for a response from a component after a request has been made. This defaults to 0 but can be changed...

I actually can't remember how to change it now but it can be done, honest!

manofprayer
Mar 15th, 2001, 04:56 PM
first t answer your question:
- yes, when you click the 'Switch To ...' the Form does gets displayed.

something strange:
-when I tried it out at home, 'coz you said it works, I noticed something different from the properties of the DLL that I've created at the office and the one I did at home. I noticed that the 'Unattended Execution' check box is disabled at home (and to let you know, my program worked well at home) and here in the office it was enabled!

- do you have an answer for this?

thank you.