Displaying an ActiveX DLL form within calling .EXE window 
Author Message
 Displaying an ActiveX DLL form within calling .EXE window

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.



Fri, 04 Feb 2000 03:00:00 GMT  
 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.



Sat, 05 Feb 2000 03:00:00 GMT  
 Displaying an ActiveX DLL form within calling .EXE window

How about trying this

create a mdi child in your main app and make that the parent of dll form.
I only suggest this because i know in vb3 i would emulate tabbed dialogs by
creating a mdi child with the tabs and then as the user switched tabs i
would load a form for each (although it was another mdi child form) and set
its parent to the mdi child with the tabs.  worked fine.

another idea may be that windows also has the concept of owner windows, so
the mdiform is the owner of its mdi children (well maybe, read on).  maybe
what you need to do is set these dll forms owner to be the mdiform.  the
api is either setwindowword or setwindowlong.  also make sure that the
mdiform is indeed the owner (api GetWindow).  for example the parent of the
mdi children isn't really the mdi form but the window that fills the
available client area of the mdiparent.  you can verify this with spy++.

--
Dan Akers  (MCSD)
Microsoft Certified Solution Developer


Empowered Software Solutions
Microsoft Solution Provider
Microsoft SiteBuilder
www.empowered.com
(888) 2-EMPOWR



Quote:

> 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



> > 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.



Sat, 05 Feb 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Displaying an ActiveX DLL form within calling .EXE window

2. Displaying an ActiveX DLL form within calling .EXE window

3. Displaying an ActiveX DLL form within calling .EXE window

4. Displaying an ActiveX DLL form within calling .EXE window

5. Get name of initiating exe/dll from within another exe/dll

6. Get name of initiating exe/dll from within another exe/dll

7. Call VB DLL or COM object from within VB COM object or EXE

8. Calling methods across classes within ActiveX-Dll

9. ActiveX EXE not displaying form

10. How to call ActiveX exe from dll?

11. Help: Display app in taskbar when GUI is called from ActiveX DLL

12. Forms within ActiveX DLL - PLEASE HELP!

 

 
Powered by phpBB® Forum Software