// Name: msw/ole/activex.h
// Purpose: interface of wxActiveXEvent
// Author: wxWidgets team
-// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
@beginEventTable{wxActiveXEvent}
@event{EVT_ACTIVEX(func)}
- Sent when the ActiveX control hosted by wxActiveXContainer recieves an
+ Sent when the ActiveX control hosted by wxActiveXContainer receives an
ActiveX event.
@endEventTable
+ ActiveX event parameters can get extremely complex and may be beyond the
+ abilities of wxVariant. If 'operator[]' fails, prints an error messages or
+ crashes the application, event handlers should use GetNativeParameters()
+ instead to obtain the original event information.
+ Calls to operator[] and GetNativeParmeters() can be mixed. It is valid
+ to handle some parameters of an event with operator[] and others directly
+ through GetNativeParameters(). It is \b not valid however to manipulate
+ the same parameter using both approaches at the same time.
+
@onlyfor{wxmsw}
@library{wxcore}
Obtains the actual parameter value specified by idx.
*/
wxVariant operator[](size_t idx);
+
+ /**
+ Obtain the original MSW parameters for the event.
+ Event handlers can use this information to handle complex event parameters
+ that are beyond the scope of wxVariant.
+ The information returned here is the information passed to the original
+ 'Invoke' method call.
+ \return a pointer to a struct containing the original MSW event parameters
+ */
+ wxActiveXEventNativeMSW *GetNativeParameters() const;
};
is a platform-specific class).
Note that the HWND that the class contains is the actual HWND of the ActiveX
- control so using dynamic events and connecting to wxEVT_SIZE, for example,
+ control so using dynamic events and connecting to @c wxEVT_SIZE, for example,
will receive the actual size message sent to the control.
It is somewhat similar to the ATL class CAxWindow in operation.
virtual bool Load(const wxString& fileName)
{
- if(m_PDF.CallMethod(wxT("LoadFile"), fileName).GetBool())
+ if(m_PDF.CallMethod("LoadFile", fileName).GetBool())
{
- m_PDF.CallMethod(wxT("setCurrentPage"), wxVariant((long)0));
+ m_PDF.CallMethod("setCurrentPage", wxVariant((long)0));
NotifyMovieLoaded(); // initial refresh
wxSizeEvent event;
m_pAX->OnSize(event);
}
virtual bool Load(const wxURI& location)
{
- return m_PDF.CallMethod(wxT("LoadFile"), location.BuildUnescapedURI()).GetBool();
+ return m_PDF.CallMethod("LoadFile", location.BuildUnescapedURI()).GetBool();
}
virtual bool Load(const wxURI& WXUNUSED(location),
const wxURI& WXUNUSED(proxy))
virtual bool SetPosition(wxLongLong where)
{
- m_PDF.CallMethod(wxT("setCurrentPage"), wxVariant((long)where.GetValue()));
+ m_PDF.CallMethod("setCurrentPage", wxVariant((long)where.GetValue()));
return true;
}
virtual wxLongLong GetPosition()
{
if(flags)
{
- m_PDF.CallMethod(wxT("setShowToolbar"), true);
- m_PDF.CallMethod(wxT("setShowScrollbars"), true);
+ m_PDF.CallMethod("setShowToolbar", true);
+ m_PDF.CallMethod("setShowScrollbars", true);
}
else
{
- m_PDF.CallMethod(wxT("setShowToolbar"), false);
- m_PDF.CallMethod(wxT("setShowScrollbars"), false);
+ m_PDF.CallMethod("setShowToolbar", false);
+ m_PDF.CallMethod("setShowScrollbars", false);
}
return true;
wxActiveXContainer* m_pAX;
wxAutomationObject m_PDF;
- DECLARE_DYNAMIC_CLASS(wxPDFMediaBackend)
+ wxDECLARE_DYNAMIC_CLASS(wxPDFMediaBackend)
};
- IMPLEMENT_DYNAMIC_CLASS(wxPDFMediaBackend, wxMediaBackend);
- Put this in one of your existant source files and then create a wxMediaCtrl with
+ wxIMPLEMENT_DYNAMIC_CLASS(wxPDFMediaBackend, wxMediaBackend);
- //[this] is the parent window, "myfile.pdf" is the PDF file to open
- wxMediaCtrl* mymediactrl = new wxMediaCtrl(this, wxT("myfile.pdf"), wxID_ANY,
+ // Put this in one of your existing source files and then create a wxMediaCtrl with
+ wxMediaCtrl* mymediactrl = new wxMediaCtrl(this, "myfile.pdf", wxID_ANY,
wxDefaultPosition, wxSize(300,300),
- 0, wxT("wxPDFMediaBackend"));
+ 0, "wxPDFMediaBackend");
+ // [this] is the parent window, "myfile.pdf" is the PDF file to open
@endcode
@onlyfor{wxmsw}
- @library{wxbase}
- @category{misc,ipc}
+ @library{wxcore}
+ @category{ctrl,ipc}
- @see wxActiveXEvent, @ref page_samples_flash Flash sample
+ @see wxActiveXEvent, @ref page_samples_flash
*/
class wxActiveXContainer : public wxControl
{
Interface of ActiveX control.
*/
wxActiveXContainer(wxWindow* parent, REFIID iid, IUnknown* pUnk);
+ /**
+ Queries host's site for interface.
+
+ @param iid
+ The iid of the required interface.
+ @param _interface
+ Double pointer to outgoing interface. Supply your own interface if desired.
+ @param desc
+ The description of the outgoing interface.
+ @return bool
+ Return true if interface supplied else return false.
+ */
+ virtual bool QueryClientSiteInterface(REFIID iid, void **_interface, const char *&desc);
};