ActiveXControlComponent Class Reference

A Windows-specific class that can create and embed an ActiveX control inside itself. More...

Inherits Component.

List of all members.

Public Member Functions

 ActiveXControlComponent ()
 Create an initially-empty container.
 ~ActiveXControlComponent ()
 Destructor.
bool createControl (const void *controlIID)
 Tries to create an ActiveX control and embed it in this peer.
void deleteControl ()
 Deletes the ActiveX control, if one has been created.
bool isControlOpen () const throw ()
 Returns true if a control is currently in use.
void * queryInterface (const void *iid) const
 Does a QueryInterface call on the embedded control object.
void setMouseEventsAllowed (bool eventsCanReachControl)
 Set this to false to stop mouse events being allowed through to the control.
bool areMouseEventsAllowed () const throw ()
 Returns true if mouse events are allowed to get through to the control.
void paint (Graphics &g)

Public Attributes

void * originalWndProc

Detailed Description

A Windows-specific class that can create and embed an ActiveX control inside itself.

To use it, create one of these, put it in place and make sure it's visible in a window, then use createControl() to instantiate an ActiveX control. The control will then be moved and resized to follow the movements of this component.

Of course, since the control is a heavyweight window, it'll obliterate any juce components that may overlap this component, but that's life.


Constructor & Destructor Documentation

ActiveXControlComponent::ActiveXControlComponent (  ) 

Create an initially-empty container.

ActiveXControlComponent::~ActiveXControlComponent (  ) 

Destructor.


Member Function Documentation

bool ActiveXControlComponent::createControl ( const void *  controlIID  ) 

Tries to create an ActiveX control and embed it in this peer.

The peer controlIID is a pointer to an IID structure - it's treated as a void* because when including the Juce headers, you might not always have included windows.h first, in which case IID wouldn't be defined.

e.g.

        const IID myIID = __uuidof (QTControl);
        myControlComp->createControl (&myIID);
void ActiveXControlComponent::deleteControl (  ) 

Deletes the ActiveX control, if one has been created.

bool ActiveXControlComponent::isControlOpen (  )  const throw ()

Returns true if a control is currently in use.

void* ActiveXControlComponent::queryInterface ( const void *  iid  )  const

Does a QueryInterface call on the embedded control object.

This allows you to cast the control to whatever type of COM object you need.

The iid parameter is a pointer to an IID structure - it's treated as a void* because when including the Juce headers, you might not always have included windows.h first, in which case IID wouldn't be defined, but you should just pass a pointer to an IID.

e.g.

        const IID iid = __uuidof (IOleWindow);

        IOleWindow* oleWindow = (IOleWindow*) myControlComp->queryInterface (&iid);

        if (oleWindow != 0)
        {
            HWND hwnd;
            oleWindow->GetWindow (&hwnd);

            ...

            oleWindow->Release();
        }
void ActiveXControlComponent::setMouseEventsAllowed ( bool  eventsCanReachControl  ) 

Set this to false to stop mouse events being allowed through to the control.

bool ActiveXControlComponent::areMouseEventsAllowed (  )  const throw ()

Returns true if mouse events are allowed to get through to the control.

void ActiveXControlComponent::paint ( Graphics g  )  [virtual]

For internal use only.

Reimplemented from Component.


Member Data Documentation

For internal use only.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Apr 26 11:42:09 2010 for JUCE by  doxygen 1.6.3