How do I center an ActiveX dialog?

I embed an ActiveX object in an HTML page. The ActiveX object immediately opens an MFC dialog. I want to center this dialog.
The CenterWindow(NULL ) function in the code does not work, nor does writing CENTER before/after the OBJECT or SCRIPT tabs in the HTML.
My code looks like this:
<OBJECT
CLASSID='clsid:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
ID='MyObj'
></OBJECT>
<SCRIPT LANGUAGE="VBScript">
MyObj.Data="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
MyObj.DoSomething
</SCRIPT>

What should I do in order to center the AcitveX's dialog?
P.S. - the subsequent dialogs open in the center of the window - no problems here.
Thanks.
gilbert_changAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oubelkasCommented:
have you tried align="center" in the object tag? Not sure if it'll work though...

Joseph
0
gilbert_changAuthor Commented:
Does not work, But thanks anyway.
0
ahchongCommented:
<CENTER>
<OBJECT
CLASSID='clsid:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
ID='MyObj'
></OBJECT>
</CENTER>
<SCRIPT LANGUAGE="VBScript">
MyObj.Data="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
MyObj.DoSomething
</SCRIPT>


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
oubelkasCommented:
ahchong> read the question first before answering because gilbert said :

The CenterWindow(NULL ) function in the code does not work, nor does writing CENTER before/after the OBJECT or SCRIPT tabs in the HTML.

So <CENTER> </CENTER> doesn't work.

Gilbert > I last read an article which said what the properties of an object tag were, so here :

CLASSID - String specifying the identification number of the control. In a client-side browser environment the CLASSID numerals must be preceded with the text CLSID:
ALIGN:
TEXTTOP - top of the object aligned with top of current font
MIDDLE - middle of object aligned with baseline of text line
TEXTMIDDLE - middle of object aligned with middle of text line
BASELINE - bottom of object aligned with baseline of text line
TEXTBOTTOM - bottom of the object is aligned with bottom of the current font
LEFT - object aligned to the left of web page and the text will flow around the right side of the object
CENTER - object aligned in the center of the page and text will end the text line above the object and resume on the next text line down
RIGHT - opposite of left alignment
CODETYPE - specifies the Internet Media Type. This will save download time if the computer does not support a particular codetype.
DATA - contains the URL pointing to data required by the object. q
DECLARE - if this attribute is present, the browser will only load the object into memory and will not execute it until it is referenced.
HEIGHT / WIDTH - sets the height / width of the object in pixels
HSPACE - sets the amount of pixels on the left and right of the object that will pad the object.
VSPACE - Same as HSpace except this defines the pixels above and below the object.
ID - gives the object a document-wide identifier.
NAME - If you use an object in a form the browser will not consider the object as part of the form unless the object is given a name.
STANDBY - A string that will be displayed while the ActiveX control loads.
TYPE - Used to specify the Internet Media Type for the data specified by the DATA attribute.
USEMAP - specifies a URL for a client-side imagemap.

I'm sure my first comment must be the right one then...mmm, check it out.

Joseph
0
oubelkasCommented:
An example used in that article :

......
<OBJECT ID="fadeScroll" WIDTH=171 HEIGHT=21 ALIGN=CENTER
  CODEBASE="http://activex.microsoft.com/controls/mspert10.cab"
  CLASSID="CLSID:DFD181E0-5E2F-11CE-A449-00AA004A803D"
  STYLE="filter:Alpha(Opacity=100, FinishOpacity=100)">
......
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.