IPCtrlWindow< BASE, SMARTPTR > Struct Template Reference

#include <webchild.h>

Inheritance diagram for IPCtrlWindow< BASE, SMARTPTR >:

Inheritance graph
[legend]
Collaboration diagram for IPCtrlWindow< BASE, SMARTPTR >:

Collaboration graph
[legend]

Public Types

typedef BASE super

Public Member Functions

 IPCtrlWindow (HWND hwnd)
template<typename T>
 IPCtrlWindow (HWND hwnd, T &info)
HRESULT create_control (HWND hwnd, REFIID clsid, REFIID riid)

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)

Protected Attributes

ComInit _usingCOM
SMARTPTR _control
OleInPlaceClient _client_side
SIfacePtr< IOleInPlaceObject > _in_place_object

Detailed Description

template<typename BASE, typename SMARTPTR>
struct IPCtrlWindow< BASE, SMARTPTR >

Definition at line 405 of file webchild.h.


Member Typedef Documentation

template<typename BASE, typename SMARTPTR>
typedef BASE IPCtrlWindow< BASE, SMARTPTR >::super

Reimplemented in WebChildWindow.

Definition at line 407 of file webchild.h.


Constructor & Destructor Documentation

template<typename BASE, typename SMARTPTR>
IPCtrlWindow< BASE, SMARTPTR >::IPCtrlWindow ( HWND  hwnd  )  [inline]

Definition at line 409 of file webchild.h.

00410      :  super(hwnd)
00411     {
00412     }

template<typename BASE, typename SMARTPTR>
template<typename T>
IPCtrlWindow< BASE, SMARTPTR >::IPCtrlWindow ( HWND  hwnd,
T &  info 
) [inline]

Definition at line 414 of file webchild.h.

00415      :  super(hwnd, info)
00416     {
00417     }


Member Function Documentation

template<typename BASE, typename SMARTPTR>
HRESULT IPCtrlWindow< BASE, SMARTPTR >::create_control ( HWND  hwnd,
REFIID  clsid,
REFIID  riid 
) [inline]

Definition at line 419 of file webchild.h.

00420     {
00421          // Erzeugen einer Instanz des Controls
00422         HRESULT hr = _control.CreateInstance(clsid, riid);
00423         if (FAILED(hr))
00424             return hr;
00425 
00426         _client_side.attach(hwnd);
00427 
00428         hr = _client_side.attach_control(SIfacePtr<IOleObject>(_control, IID_IOleObject)/*, OLEIVERB_INPLACEACTIVATE,
00429                                             hwnd, &Rect(10, 10, 500, 500)*/);
00430         if (FAILED(hr))
00431             return hr;
00432 
00433          // try to get a IOleInPlaceObject interface for window resizing
00434         return _control.QueryInterface(IID_IOleInPlaceObject, &_in_place_object);   // _in_place_object = _control
00435     }

template<typename BASE, typename SMARTPTR>
LRESULT IPCtrlWindow< BASE, SMARTPTR >::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
) [inline, protected]

Reimplemented in WebChildWindow.

Definition at line 438 of file webchild.h.

00439     {
00440         if (nmsg == WM_SIZE) {
00441             if (_in_place_object) {
00442                 RECT rect = {0, 0, LOWORD(lparam), HIWORD(lparam)};
00443 
00444                 _in_place_object->SetObjectRects(&rect, &rect);
00445             }
00446         } else if (nmsg == WM_CLOSE) {
00447             _in_place_object = NULL;
00448 
00449             if (_control) {
00450                 _client_side.detach(SIfacePtr<IOleObject>(_control, IID_IOleObject), OLECLOSE_NOSAVE);
00451                 _control = NULL;
00452             }
00453         }
00454 
00455         return super::WndProc(nmsg, wparam, lparam);
00456     }


Field Documentation

template<typename BASE, typename SMARTPTR>
ComInit IPCtrlWindow< BASE, SMARTPTR >::_usingCOM [protected]

Definition at line 458 of file webchild.h.

template<typename BASE, typename SMARTPTR>
SMARTPTR IPCtrlWindow< BASE, SMARTPTR >::_control [protected]

Definition at line 459 of file webchild.h.

Referenced by IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::create_control(), and IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::WndProc().

template<typename BASE, typename SMARTPTR>
OleInPlaceClient IPCtrlWindow< BASE, SMARTPTR >::_client_side [protected]

Definition at line 460 of file webchild.h.

Referenced by IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::create_control(), and IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::WndProc().

template<typename BASE, typename SMARTPTR>
SIfacePtr<IOleInPlaceObject> IPCtrlWindow< BASE, SMARTPTR >::_in_place_object [protected]

Definition at line 461 of file webchild.h.

Referenced by IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::create_control(), and IPCtrlWindow< ChildWindow, SIfacePtr< IWebBrowser2 > >::WndProc().


The documentation for this struct was generated from the following file:
IBrowser Source Code Documentation
generated on 18.09.2008 by doxygen

Homepage