beermann
beermann

Reputation: 358

Embed WTL App in ATL ActiveX control

Is there a way to somehow Embed a WTL destop application in ATL ActiveX (ie extension)?

What I'm trying to achieve is to create an ActiveX control with office files Viewer. As a base I have a desktop WTL application (written some time ago) which uses OOo v3 API to display documents.

And here my luck (and knowledge?) ended.

My control has m_hwnd property but it is always set to 0; I've Googled a bit and found that i Can get parent hwnd with

this->m_spInPlaceSite->GetWindow()

but it's not working either. Every time I want to create a window runtime ends in IsWindow() method (called from within ATL lib) with parent==null

To create and show OOo::DocWindow I need HWND of the parent Window.

And here goes the question:

Can i somehow embed a WTL Window-based application in ActiveX ie extension?
Is it possible without re-writing whole OOo Api wrapper?

Upvotes: 0

Views: 892

Answers (1)

Eugene
Eugene

Reputation: 3417

Yes, you can.

Steps with VS wizard:

  1. Create ATL project
  2. Add ATL Control, based on some control (button, for example). In this case you'll have message map with some handlers.

Then replace CContainedWindow member to your own window and that's all.

ATL Samples page, I didn't check it, but hope it helps.

Upvotes: 1

Related Questions