Advertisement Jump to content


This topic is now archived and is closed to further replies.


ActiveX and DirectX

This topic is 5353 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Lets say I wanted to create an HTML page with and ActiveX control embedded in it that would be able to render DirectX graphics. Does anyone have any tips on how to go about doing this? I should probably be working now...

Share this post

Link to post
Share on other sites
1) Unless this was a personal technical experiment, I probably wouldn''t re-invent the wheel and use an existing solution:

2a) Unless you''re extremely competent with COM and OLE/ActiveX and what all of the interfaces associated with embedding in particular are and do (IOleInPlaceObject for example), then making a *fully featured* and *well behaved* control with plain Win32 will be quite painful.

2b) Using the MFC ActiveX Control Wizard is the easiest way to take most of the pain away for getting the control itself up and running. If you really don''t want to use MFC (I''d advise using it, even for a prototype), ATL will take a little bit of the pain away.

3) The best way to approach your problem is to split the tasks up and tackle them separately - I see three listed in your request: *1* make an ActiveX control *2* make the ActiveX control work in a web page *3* make the ActiveX control render DirectX graphics output. I would tackle the problems in that order.

4a) For tasks 1 & 2, I''d use MFCs ActiveX control Wizard and set up a window area of the browser for DirectX output - possibly subclassing something like a static control.

4b) Once you have all of the browser interaction working as expected and a window reserved for the DirectX output, then you can set about displaying the content. Take a look at the MFCTex and MFCFog samples in the DirectX SDK to see how to make DirectX output work within an MFC app - getting the HWND of an ActiveX control in a browser shouldn''t take much more work.

Simon O''Connor
Game Programmer &
Microsoft DirectX MVP

Share this post

Link to post
Share on other sites
I''ve done something very much like this with OpenGL. I got stuck when it came to accessing the arguments specified for the html tag, though (so I could give it a source URL), so if you find out how to do that, I''d be interested.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!