PDA

Click to See Complete Forum and Search --> : modal form from ActiveX dll


Scott Penner
Dec 13th, 2000, 05:49 PM
I've got an application where I need to show some forms from a dll. The problem is trying to make these forms modal to the main form. I have an inkling that I've solved this problem before, but (!?) I can't remember how.
If I make the dll form modal, without a parent, then it still locks out the main form (like it should) but is not displayed on top of the main form. This means it can get lost behind other windows etc.
I've tried passing the parent form to the public class, but VB doesn't like it. I get an error: Private object modules cannot be used in public object modules as parameters or return types...blah...blah...blah

Any suggestions?

RManzione
Dec 14th, 2000, 02:43 AM
How are you loading the form? I call modal forms like this from my DLLs all the time and it works fine..

In my main app


Dim clForm as new myobject.myclass

clForm.show





In my DLL class


Public Function show()

frmabout.show vbModal 'frmabout is the form being loaded in the dll

End Function

Scott Penner
Dec 14th, 2000, 04:16 PM
Thanks. I figured it out. It was a problem that occured while running in debug mode. Once I compiled the dll and ran from that, the modal form worked as planned.
Regards,