summaryrefslogtreecommitdiff
path: root/extensions/test/ole
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2000-10-13 14:35:00 +0000
committerJoachim Lingner <jl@openoffice.org>2000-10-13 14:35:00 +0000
commit57c7e9e36955241eebcf23b883373d89afa7dea8 (patch)
treebde51b1d0c71122fa553077f42df8e07de05180f /extensions/test/ole
parent4297babd82aa72616223b2d491fa7002ff67d567 (diff)
adding means for hosting MFC ActiveX controls
Diffstat (limited to 'extensions/test/ole')
-rw-r--r--extensions/test/ole/OleClient/axhost.cxx85
-rw-r--r--extensions/test/ole/OleClient/axhost.hxx93
2 files changed, 178 insertions, 0 deletions
diff --git a/extensions/test/ole/OleClient/axhost.cxx b/extensions/test/ole/OleClient/axhost.cxx
new file mode 100644
index 000000000000..5a5286c0d81e
--- /dev/null
+++ b/extensions/test/ole/OleClient/axhost.cxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * $RCSfile: axhost.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: jl $ $Date: 2000-10-13 15:34:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#include "axhost.hxx"
+
+HostWin::HostWin(LPWSTR progid)
+{
+ controlName= progid;
+ RECT rcPos={0,0,200,200};
+ Create(0, rcPos, _T("HostWin"));
+}
+HostWin::~HostWin()
+{
+ DestroyWindow();
+}
+
+
+LRESULT HostWin::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
+{
+ CAxWindow wnd(m_hWnd);
+
+ HRESULT hr= wnd.CreateControlEx( controlName, NULL, NULL,&spControl.p);
+
+ return 0;
+}
+
diff --git a/extensions/test/ole/OleClient/axhost.hxx b/extensions/test/ole/OleClient/axhost.hxx
new file mode 100644
index 000000000000..c52a2b66d307
--- /dev/null
+++ b/extensions/test/ole/OleClient/axhost.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * $RCSfile: axhost.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: jl $ $Date: 2000-10-13 15:35:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef __AXHOST_HXX
+#define __AXHOST_HXX
+
+#include <atlbase.h>
+extern CComModule _Module;
+#include <atlwin.h>
+#include <atlcom.h>
+#include <atlhost.h>
+
+
+class HostWin: public CWindowImpl<HostWin, CWindow,
+ CWinTraits< WS_CAPTION|WS_POPUPWINDOW|WS_VISIBLE, 0> >
+{
+ CComBSTR controlName;
+ CComPtr<IUnknown> spControl;
+public:
+ HostWin(LPWSTR progid);
+
+ ~HostWin();
+
+
+ BEGIN_MSG_MAP(HostWin)
+ MESSAGE_HANDLER( WM_CREATE, OnCreate)
+ END_MSG_MAP()
+
+ IUnknown* GetHostedControl(){
+ return spControl;
+ }
+
+ LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
+};
+#endif \ No newline at end of file