
Displaying an ActiveX DLL form within calling .EXE window
I' m trying to do almost the excact same thing. We've got a rather large
app which consists of several discrete modules all running under the same
MDI parent form. I have pulled out one module, redesigned it so that is
stand alone apart from some parameters which need to be passed to it
through class interfaces, and compiled it as an AxtiveX dll, and then
pointed a reference to it from the MDI project.
I'm using SetParent to make the dll's forms children of the MDI, and I am
experiencing the same stuff as you. Fortunately, our app runs either full
screen or minimized, so the user can't drag it the child forms.
In our MDI, we have a picture box serving as a tool bar. Normally, a child
window would respect this and maximize below the picture box, but not so
with SetParent. So I have to pass the .Height property of the picture box
to the dll, and this sets the .Top property of the dll forms.
It still looks a bit unnatural, though. Additionally, when the child form
gets activated, the MDI title bar turns system grey - normally both the
child and the parent forms will get the system activated title bar color.
I just bought Spy Works, and I'm thinking of trying to use it to intercept
the message that is notifying the MDI that it has lost focus (don't know
that this is possible).
I gotta think that there is a better way, but I have seen several other
posts of this nature in the NGs, and haven't found a solid answer yet.
Any insights would be greatly welcomed.
Will keep you posted, please let me know if anyone finds anything.
Regards,
Matt
Quote:
> I am trying to display a form from an ActiveX DLL within the window of my
> executable. My goal is to allow for form "plug-ins". I can easily display
> the form modeless, on top of my EXE window, and I can even use
> SetParent() to display it within a frame of my EXE window.
> However, when using the latter approach, the EXE window title bar greys
> out, as it I were to Alt-Tab to a different app. I didn't think this
> would happen with an in-process DLL form. Since my main EXE form is an
> MDIForm, I tried making the DLL forms MDI children, but get an #366 Error
> "No MDI Form available to load".
> Any ideas? I'm getting ready to pull out Petzold and start refreshing my
> memory on the finer points of MDI but would be happy to suggestions.
> --
> Read a good book and have a life... death to Spam!!!
> Pursuant to US Code, Title 47, Chapter 5, Subchapter II, Sec. 227,
> any and all nonsolicited commercial E-mail sent to this address is
> subject to a download and archival fee in the amount of $500 US.
> E-mailing denotes acceptance of these terms.