Add .net control to ATL window
Hello All!
How can I add .net control to ATL window?
I don't need to pass any message between ATL and C#,
only "paste" the control on ATL window.
thanks!
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pedro BarbasPosted Aug 19, 2009, 11:05 AM
Hi,
The first step is to create the activex control like in http://www.c-sharpcorner.com/UploadFile/dsandor/ActiveXInNet11102005040748AM/ActiveXInNet.aspx
Second step is to use CAxHostWindow that implements the necessary interfaces in order to support the hosting of common ActiveX controls (including windowless) and Microsoft Web Browser control. In case you do not need to host a Web Browser control, you can define _ATL_NO_DOCHOSTUIHANDLER in your project and save about 4K in release dll. CAxHostWindow derives from CWindowImpl, and this means it needs a window to operate. CAxHostWindow can host only one control at a time, and as a result, one CAxHostWindow is required for each hosted control.