Click to See Complete Forum and Search --> : Centering a ActiveX Dll's form


Lav
January 6th, 2000, 10:11 PM
How do i centre a ActiveX DLL 's form inside a main application MDI window.
I have used the activex dll as plugin to the main application

Crazy D @ Work
January 7th, 2000, 02:00 AM
Pass the form as either a Form or an Object to the dll (not sure without checking if a form is allowed), then you can show the form using the optional parent parameter. If you've set the forms Startup position to centerowner, it should work.
Note though that you can't put an mdi child in a dll; if you want it to act like an mdi child you need to modify the window style and make the mdi form the parent of your form.

Crazy D @ Work :-)

Chris Eastwood
January 7th, 2000, 03:41 AM
Just as a side note Dan Appleman (he of the WinAPI bible) wrote an excellent article in the VBPJ last march on developing an extendable MDI framework using ActiveX DLL's and forms. I lost my copy of the magazine ages ago, but just noticed that it's now freely available on the MSDN at :

http://msdn.microsoft.com/library/periodic/period99/vbpj/da0399.htm

It's a bit heavy going, but well worth it if you want to develop an extendable MDI system. (much better than the clunky SetParent API anyway!)



Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb

Crazy D @ Work
January 7th, 2000, 03:53 AM
That's a cool one Chris!

Crazy D @ Work :-)