Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

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]

List of all members.

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 321 of file webchild.h.


Member Typedef Documentation

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

Reimplemented in WebChildWindow.

Definition at line 323 of file webchild.h.


Constructor & Destructor Documentation

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

Definition at line 325 of file webchild.h.

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

Definition at line 330 of file webchild.h.

     :  super(hwnd, info)
    {
    }

Member Function Documentation

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

Definition at line 335 of file webchild.h.

    {
         // Erzeugen einer Instanz des Controls
        HRESULT hr = _control.CreateInstance(clsid, riid);
        if (FAILED(hr))
            return hr;

        _client_side.attach(hwnd);

        hr = _client_side.attach_control(SIfacePtr<IOleObject>(_control, IID_IOleObject)/*, OLEIVERB_INPLACEACTIVATE,
                                            hwnd, &Rect(10, 10, 500, 500)*/);
        if (FAILED(hr))
            return hr;

         // try to get a IOleInPlaceObject interface for window resizing
        return _control.QueryInterface(IID_IOleInPlaceObject, &_in_place_object);   // _in_place_object = _control
    }
template<typename BASE, typename SMARTPTR>
LRESULT IPCtrlWindow< BASE, SMARTPTR >::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
) [inline, protected]

Reimplemented in WebChildWindow.

Definition at line 354 of file webchild.h.

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

    {
        if (nmsg == WM_SIZE) {
            if (_in_place_object) {
                RECT rect = {0, 0, LOWORD(lparam), HIWORD(lparam)};

                _in_place_object->SetObjectRects(&rect, &rect);
            }
        } else if (nmsg == WM_CLOSE) {
            _in_place_object = NULL;

            if (_control) {
                _client_side.detach(SIfacePtr<IOleObject>(_control, IID_IOleObject), OLECLOSE_NOSAVE);
                _control = NULL;
            }
        }

        return super::WndProc(nmsg, wparam, lparam);
    }

Here is the caller graph for this function:


Member Data Documentation

template<typename BASE, typename SMARTPTR>
OleInPlaceClient IPCtrlWindow< BASE, SMARTPTR >::_client_side [protected]
template<typename BASE, typename SMARTPTR>
SMARTPTR IPCtrlWindow< BASE, SMARTPTR >::_control [protected]
template<typename BASE, typename SMARTPTR>
SIfacePtr<IOleInPlaceObject> IPCtrlWindow< BASE, SMARTPTR >::_in_place_object [protected]
template<typename BASE, typename SMARTPTR>
ComInit IPCtrlWindow< BASE, SMARTPTR >::_usingCOM [protected]

Definition at line 374 of file webchild.h.


The documentation for this struct was generated from the following file:

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage