From 6d094bafb374b9b5fefdbaeddbfd5053fcd368be Mon Sep 17 00:00:00 2001 From: Damien Fouilleul Date: Thu, 17 Feb 2005 12:06:01 +0000 Subject: [PATCH] - miscelleanous fixes and improvements - self registration (Internet installation now possible) --- activex/Makefile.am | 24 ++-- activex/README.TXT | 39 ++++-- activex/axvlc.idl | 53 +++++--- activex/axvlc.inf | 11 ++ activex/axvlc.tlb | Bin 5644 -> 5644 bytes activex/axvlc_idl.c | 34 ++--- activex/axvlc_idl.h | 117 +++++++++-------- activex/main.cpp | 245 ++++++++++++++++++++++++++++++++++- activex/oleobject.cpp | 20 ++- activex/persistpropbag.cpp | 2 +- activex/plugin.cpp | 31 +++-- activex/plugin.h | 14 +- activex/provideclassinfo.cpp | 2 +- activex/test.html | 2 +- activex/vlccontrol.cpp | 12 +- configure.ac | 6 +- 16 files changed, 451 insertions(+), 161 deletions(-) create mode 100644 activex/axvlc.inf diff --git a/activex/Makefile.am b/activex/Makefile.am index d89eaf25af..f77e21d1fe 100644 --- a/activex/Makefile.am +++ b/activex/Makefile.am @@ -38,21 +38,21 @@ SOURCES_activex = \ plugin.h \ axvlc_idl.c \ axvlc_idl.h \ - $(NULL) + $(NULL) DIST_rsrc = \ - axvlc_rc.rc \ - $(NULL) + axvlc_rc.rc \ + $(NULL) DIST_misc = \ - README.TXT \ - axvlc.def \ - axvlc.idl \ - axvlc.reg \ - axvlc.tlb \ - inplace.bmp \ - test.html \ - $(NULL) + README.TXT \ + axvlc.def \ + axvlc.idl \ + axvlc.reg \ + axvlc.tlb \ + inplace.bmp \ + test.html \ + $(NULL) LIBRARIES_libvlc = $(top_builddir)/lib/libvlc.a @@ -96,7 +96,7 @@ endif DATA_axvlc_rc = $(noinst_axvlc_rc_DATA) noinst_axvlc_rc_DATA = axvlc_rc.$(OBJEXT) noinst_axvlc_rcdir = $(libdir) -axvlc_rc.$(OBJEXT): axvlc_rc.rc inplace.bmp $(axvlc_tlb_DATA) +axvlc_rc.$(OBJEXT): axvlc_rc.rc inplace.bmp axvlc.tlb $(WINDRES) -DVERSION=$(VERSION) -DVERSION_NUMBER=`echo $(VERSION).0.0.0 | sed 's/\([0-9]*\)[^.]*\.*\([0-9]*\)[^.]*\.*\([0-9]*\)[^.]*\.*\([0-9]*\).*/\1,\2,\3,\4/'` --include-dir $(srcdir) -i $< -o $@ else diff --git a/activex/README.TXT b/activex/README.TXT index 40bd005e0e..677fe9271a 100644 --- a/activex/README.TXT +++ b/activex/README.TXT @@ -3,13 +3,16 @@ The VLC ActiveX Control has been primary designed to work with Internet Explorer. however it may also work with Visual Basic and/or .NET Please note, that this code does not rely upon MFC/ATL, hence good compatibility -is not guaranteed +is not guaranteed. == Compiling == -In order to script the ActiveX Control on Internet Explorer, a type library is required. +The Active Control should compile without any glitches as long as you have the latest +version of mingw gcc and headers. However, In order to script the ActiveX Control +on Internet Explorer, a type library is required. + This type library is usually generated from an IDL file using Microsoft MIDL compiler. -However, for convenience I have checked in the output of the MIDL compiler in the +Therefore, for convenience I have checked in the output of the MIDL compiler in the repository so that you will only need the MIDL compiler if you change axvlc.idl. the generated files are as follow: @@ -28,18 +31,36 @@ export MIDL="midl" if you are cross-compiling on Linux, you may be able to use 'widl' which is part of the WINE project (http://www.winehq.com), however I have not tested it. -== Installing == +== Local Install == -The ActiveX control is built as axvlc.dll, which is the only file that needs be +The ActiveX control is built as a DLL file, which is the only file that needs be distributed and it may be installed anywhere on the target machine as long as -its path is correct within the registry. -the necessary registry settings are stored in axvlc.reg +its path is specified within your PATH environment variable. Typically, you would +install it into your WINDOWS directory. -in order to use the plugin, you will need to VLC properly installed on your system -otherwise make sure that the plugin path is set in the registry as indicated below +if the control needs other VLC plugins, you will need to have VLC installed +on your system, otherwise make sure that the plugin path is set in the registry +as indicated below [HKEY_LOCAL_MACHINE\Software\VideoLAN\VLC] InstallDir="path\\dir\\" +WARNING: The plugins version must also match the ActiveX control version, +otherwise it may crash while attempting to load incompatible plugins + +== Internet Install == + +The activex control may be installed from a remote through Internet Installer if +it is packaged up in a CAB file. The following link explains how to achieve this + +http://msdn.microsoft.com/workshop/components/activex/packaging.asp + +For convenience, I have provide a sample axvlc.INF file, which installs the ActiveX Control +into the WINDOWS directory, feel free to adapt it to your need. + +WARNING: For remote install, the ActiveX Control should be built with all required VLC +plugins built-in. + regards, Damien Fouilleul + diff --git a/activex/axvlc.idl b/activex/axvlc.idl index 92f82a65b6..edf462b40a 100644 --- a/activex/axvlc.idl +++ b/activex/axvlc.idl @@ -34,15 +34,27 @@ library AXVLC dispinterface DVLCEvents; enum VLCPlaylistMode { - VLCPlayListInsert = 1, - VLCPlayListReplace = 2, - VLCPlayListAppend = 4, - VLCPlayListGo = 8, - VLCPlayListCheckInsert = 16 + VLCPlayListInsert = 1, + VLCPlayListReplace = 2, + VLCPlayListAppend = 4, + VLCPlayListGo = 8, + VLCPlayListCheckInsert = 16 }; // playlist target position - const int VLCPlayListEnd = -666; + const int VLCPlayListEnd = -666; + + // DISPID definitions + const int DISPID_Visible = 1; + const int DISPID_Playing = 2; + const int DISPID_Position = 3; + const int DISPID_Time = 4; + const int DISPID_Length = 5; + const int DISPID_Volume = 6; + + const int DISPID_PlayEvent = 1; + const int DISPID_PauseEvent = 2; + const int DISPID_StopEvent = 3; [ odl, @@ -53,13 +65,14 @@ library AXVLC oleautomation ] interface IVLCControl : IDispatch { + [id(0), bindable, defaultbind, propget, helpstring("Specifies current target in playlist")] HRESULT Value([out, retval] VARIANT* pvarValue); [id(0), bindable, defaultbind, propput, helpstring("Specifies current target in playlist")] HRESULT Value([in] VARIANT pvarValue); - [propget, bindable, helpstring("Shows or hides plugin.")] + [id(DISPID_Visible), propget, bindable, helpstring("Shows or hides plugin.")] HRESULT Visible([out, retval] VARIANT_BOOL* visible); - [propput, bindable, helpstring("Shows or hides plugin.")] + [id(DISPID_Visible), propput, bindable, helpstring("Shows or hides plugin.")] HRESULT Visible([in] VARIANT_BOOL visible); [helpstring("Play current target in playlist.")] HRESULT play(); @@ -67,31 +80,31 @@ library AXVLC HRESULT pause(); [helpstring("Stop playback.")] HRESULT stop(); - [propget, helpstring("Specifies whether VLC is playing.")] + [id(DISPID_Playing), bindable, propget, helpstring("Specifies whether VLC is playing.")] HRESULT Playing([out, retval] VARIANT_BOOL* isPlaying); - [propput, helpstring("Specifies whether VLC is playing.")] + [id(DISPID_Playing), bindable, propput, helpstring("Specifies whether VLC is playing.")] HRESULT Playing([in] VARIANT_BOOL isPlaying); - [propget, helpstring("Specifies playback position within current target in playlist, position is a relative value ranging from 0.0 to 1.0.")] + [id(DISPID_Position), bindable, propget, helpstring("Specifies playback position within current target in playlist, position is a relative value ranging from 0.0 to 1.0.")] HRESULT Position([out, retval] float* position); - [propput, helpstring("Specifies playback position within current target in playlist, position is a relative value ranging from 0.0 to 1.0.")] + [id(DISPID_Position), bindable, propput, helpstring("Specifies playback position within current target in playlist, position is a relative value ranging from 0.0 to 1.0.")] HRESULT Position([in] float position); - [propget, helpstring("Specifies playback time relative to the start of current target in playlist.")] + [id(DISPID_Time), bindable, propget, helpstring("Specifies playback time relative to the start of current target in playlist.")] HRESULT Time([out, retval] int* seconds); - [propput, helpstring("Specifies playback time relative to the start of current target in playlist.")] + [id(DISPID_Time), bindable, propput, helpstring("Specifies playback time relative to the start of current target in playlist.")] HRESULT Time([in] int seconds); [helpstring("Advance or backtrack playback time, relative to current time.")] HRESULT shuttle([in] int seconds); [helpstring("Switch between normal and fullscreen video.")] HRESULT fullscreen(); - [propget, helpstring("Returns total length in seconds of current target in playlist, may be unknown.")] + [id(DISPID_Length), bindable, propget, helpstring("Returns total length in seconds of current target in playlist, may be unknown.")] HRESULT Length([out, retval] int* seconds); [helpstring("Increases playback speed, one of 1x, 2x, 4x, 8x.")] HRESULT playFaster(); [helpstring("Decreases playback speed, one of 1x, 2x, 4x, 8x.")] HRESULT playSlower(); - [propget, helpstring("Specifies playback sound volume, ranges from 0 to 200%.")] + [id(DISPID_Volume), bindable, propget, helpstring("Specifies playback sound volume, ranges from 0 to 200%.")] HRESULT Volume([out, retval] int* volume); - [propput, helpstring("Specifies playback sound volume, ranges from 0 to 200%.")] + [id(DISPID_Volume), bindable, propput, helpstring("Specifies playback sound volume, ranges from 0 to 200%.")] HRESULT Volume([in] int volume); [helpstring("Mute/unmute playback sound volume.")] HRESULT toggleMute(); @@ -125,11 +138,11 @@ library AXVLC dispinterface DVLCEvents { properties: methods: - [id(1), helpstring("Playback in progress")] + [id(DISPID_PlayEvent), helpstring("Playback in progress")] void Play(); - [id(2), helpstring("Playback has paused")] + [id(DISPID_PauseEvent), helpstring("Playback has paused")] void Pause(); - [id(3), helpstring("Playback has stopped")] + [id(DISPID_StopEvent), helpstring("Playback has stopped")] void Stop(); }; diff --git a/activex/axvlc.inf b/activex/axvlc.inf new file mode 100644 index 0000000000..1f8e6771aa --- /dev/null +++ b/activex/axvlc.inf @@ -0,0 +1,11 @@ +[version] + signature="$CHICAGO$" + AdvancedINF=2.0 +[Add.Code] + axvlc.dll=axvlc.dll +[axvlc.dll] + file-win32-x86=thiscab + clsid={E23FE9C6-778E-49d4-B537-38FCDE4887D8} + FileVersion=0,8,2,0 + DestDir=10 + RegisterServer=yes diff --git a/activex/axvlc.tlb b/activex/axvlc.tlb index 2f995b2e4fb419f276084c56d14f006b17079df9..71e0409dbf70e7ae9081282b9fcf25a8d2f19f04 100755 GIT binary patch delta 150 zcmeCt>CxHnijPGpS;T4cJ3c!`MwZFC0@^?_5=^#&$&Fz0E|}yLECG zn5 HVI3v_0`wQU delta 150 zcmeCt>CxHnijSrD%Lm8J@A&K(85t()3TOk#NHEz7CO3k~yI_)2upB7cD3}c--wFa% zZk80PXY^oVU`haC79eH?Vm2UVhhk134Z_?|%nPLXfS4bM1%Ox(h=rhd^8;ZWCIG6n B9qRx9 diff --git a/activex/axvlc_idl.c b/activex/axvlc_idl.c index 1d96f931a6..ae90e8b779 100644 --- a/activex/axvlc_idl.c +++ b/activex/axvlc_idl.c @@ -1,25 +1,17 @@ -/***************************************************************************** - * axvlc_idl.c: ActiveX control for VLC - ***************************************************************************** - * Copyright (C) 2005 VideoLAN - * - * Authors: Damien Fouilleul - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ +/* this file contains the actual definitions of */ +/* the IIDs and CLSIDs */ +/* link this file in with the server and any clients */ + + +/* File created by MIDL compiler version 5.01.0164 */ +/* at Thu Feb 17 09:25:54 2005 + */ +/* Compiler settings for axvlc.idl: + Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data +*/ +//@@MIDL_FILE_HEADING( ) #ifdef __cplusplus extern "C"{ #endif diff --git a/activex/axvlc_idl.h b/activex/axvlc_idl.h index b201f71447..545e0bdb28 100644 --- a/activex/axvlc_idl.h +++ b/activex/axvlc_idl.h @@ -1,24 +1,15 @@ -/***************************************************************************** - * axvlc_idl.h: ActiveX control for VLC - ***************************************************************************** - * Copyright (C) 2005 VideoLAN - * - * Authors: Damien Fouilleul - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. - *****************************************************************************/ +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + +/* File created by MIDL compiler version 5.01.0164 */ +/* at Thu Feb 17 09:25:54 2005 + */ +/* Compiler settings for axvlc.idl: + Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext + error checks: allocation ref bounds_check enum stub_data +*/ +//@@MIDL_FILE_HEADING( ) + /* verify that the version is high enough to compile this file*/ #ifndef __REQUIRED_RPCNDR_H_VERSION__ @@ -83,6 +74,24 @@ enum VLCPlaylistMode }; #define VLCPlayListEnd ( -666 ) +#define DISPID_Visible ( 1 ) + +#define DISPID_Playing ( 2 ) + +#define DISPID_Position ( 3 ) + +#define DISPID_Time ( 4 ) + +#define DISPID_Length ( 5 ) + +#define DISPID_Volume ( 6 ) + +#define DISPID_PlayEvent ( 1 ) + +#define DISPID_PauseEvent ( 2 ) + +#define DISPID_StopEvent ( 3 ) + EXTERN_C const IID LIBID_AXVLC; @@ -107,10 +116,10 @@ EXTERN_C const IID IID_IVLCControl; virtual /* [helpstring][propput][defaultbind][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Value( /* [in] */ VARIANT pvarValue) = 0; - virtual /* [helpstring][bindable][propget] */ HRESULT STDMETHODCALLTYPE get_Visible( + virtual /* [helpstring][bindable][propget][id] */ HRESULT STDMETHODCALLTYPE get_Visible( /* [retval][out] */ VARIANT_BOOL __RPC_FAR *visible) = 0; - virtual /* [helpstring][bindable][propput] */ HRESULT STDMETHODCALLTYPE put_Visible( + virtual /* [helpstring][bindable][propput][id] */ HRESULT STDMETHODCALLTYPE put_Visible( /* [in] */ VARIANT_BOOL visible) = 0; virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE play( void) = 0; @@ -119,22 +128,22 @@ EXTERN_C const IID IID_IVLCControl; virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE stop( void) = 0; - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Playing( + virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Playing( /* [retval][out] */ VARIANT_BOOL __RPC_FAR *isPlaying) = 0; - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_Playing( + virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Playing( /* [in] */ VARIANT_BOOL isPlaying) = 0; - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Position( + virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Position( /* [retval][out] */ float __RPC_FAR *position) = 0; - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_Position( + virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Position( /* [in] */ float position) = 0; - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Time( + virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Time( /* [retval][out] */ int __RPC_FAR *seconds) = 0; - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_Time( + virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Time( /* [in] */ int seconds) = 0; virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE shuttle( @@ -142,17 +151,17 @@ EXTERN_C const IID IID_IVLCControl; virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE fullscreen( void) = 0; - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Length( + virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Length( /* [retval][out] */ int __RPC_FAR *seconds) = 0; virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playFaster( void) = 0; virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playSlower( void) = 0; - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Volume( + virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Volume( /* [retval][out] */ int __RPC_FAR *volume) = 0; - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_Volume( + virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Volume( /* [in] */ int volume) = 0; virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE toggleMute( void) = 0; @@ -234,11 +243,11 @@ EXTERN_C const IID IID_IVLCControl; IVLCControl __RPC_FAR * This, /* [in] */ VARIANT pvarValue); - /* [helpstring][bindable][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Visible )( + /* [helpstring][bindable][propget][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Visible )( IVLCControl __RPC_FAR * This, /* [retval][out] */ VARIANT_BOOL __RPC_FAR *visible); - /* [helpstring][bindable][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Visible )( + /* [helpstring][bindable][propput][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Visible )( IVLCControl __RPC_FAR * This, /* [in] */ VARIANT_BOOL visible); @@ -251,27 +260,27 @@ EXTERN_C const IID IID_IVLCControl; /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *stop )( IVLCControl __RPC_FAR * This); - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Playing )( + /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Playing )( IVLCControl __RPC_FAR * This, /* [retval][out] */ VARIANT_BOOL __RPC_FAR *isPlaying); - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Playing )( + /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Playing )( IVLCControl __RPC_FAR * This, /* [in] */ VARIANT_BOOL isPlaying); - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Position )( + /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Position )( IVLCControl __RPC_FAR * This, /* [retval][out] */ float __RPC_FAR *position); - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Position )( + /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Position )( IVLCControl __RPC_FAR * This, /* [in] */ float position); - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Time )( + /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Time )( IVLCControl __RPC_FAR * This, /* [retval][out] */ int __RPC_FAR *seconds); - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Time )( + /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Time )( IVLCControl __RPC_FAR * This, /* [in] */ int seconds); @@ -282,7 +291,7 @@ EXTERN_C const IID IID_IVLCControl; /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *fullscreen )( IVLCControl __RPC_FAR * This); - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Length )( + /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Length )( IVLCControl __RPC_FAR * This, /* [retval][out] */ int __RPC_FAR *seconds); @@ -292,11 +301,11 @@ EXTERN_C const IID IID_IVLCControl; /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *playSlower )( IVLCControl __RPC_FAR * This); - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Volume )( + /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Volume )( IVLCControl __RPC_FAR * This, /* [retval][out] */ int __RPC_FAR *volume); - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Volume )( + /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Volume )( IVLCControl __RPC_FAR * This, /* [in] */ int volume); @@ -482,7 +491,7 @@ void __RPC_STUB IVLCControl_put_Value_Stub( DWORD *_pdwStubPhase); -/* [helpstring][bindable][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Visible_Proxy( +/* [helpstring][bindable][propget][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Visible_Proxy( IVLCControl __RPC_FAR * This, /* [retval][out] */ VARIANT_BOOL __RPC_FAR *visible); @@ -494,7 +503,7 @@ void __RPC_STUB IVLCControl_get_Visible_Stub( DWORD *_pdwStubPhase); -/* [helpstring][bindable][propput] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Visible_Proxy( +/* [helpstring][bindable][propput][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Visible_Proxy( IVLCControl __RPC_FAR * This, /* [in] */ VARIANT_BOOL visible); @@ -539,7 +548,7 @@ void __RPC_STUB IVLCControl_stop_Stub( DWORD *_pdwStubPhase); -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Playing_Proxy( +/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Playing_Proxy( IVLCControl __RPC_FAR * This, /* [retval][out] */ VARIANT_BOOL __RPC_FAR *isPlaying); @@ -551,7 +560,7 @@ void __RPC_STUB IVLCControl_get_Playing_Stub( DWORD *_pdwStubPhase); -/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Playing_Proxy( +/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Playing_Proxy( IVLCControl __RPC_FAR * This, /* [in] */ VARIANT_BOOL isPlaying); @@ -563,7 +572,7 @@ void __RPC_STUB IVLCControl_put_Playing_Stub( DWORD *_pdwStubPhase); -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Position_Proxy( +/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Position_Proxy( IVLCControl __RPC_FAR * This, /* [retval][out] */ float __RPC_FAR *position); @@ -575,7 +584,7 @@ void __RPC_STUB IVLCControl_get_Position_Stub( DWORD *_pdwStubPhase); -/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Position_Proxy( +/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Position_Proxy( IVLCControl __RPC_FAR * This, /* [in] */ float position); @@ -587,7 +596,7 @@ void __RPC_STUB IVLCControl_put_Position_Stub( DWORD *_pdwStubPhase); -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Time_Proxy( +/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Time_Proxy( IVLCControl __RPC_FAR * This, /* [retval][out] */ int __RPC_FAR *seconds); @@ -599,7 +608,7 @@ void __RPC_STUB IVLCControl_get_Time_Stub( DWORD *_pdwStubPhase); -/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Time_Proxy( +/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Time_Proxy( IVLCControl __RPC_FAR * This, /* [in] */ int seconds); @@ -634,7 +643,7 @@ void __RPC_STUB IVLCControl_fullscreen_Stub( DWORD *_pdwStubPhase); -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Length_Proxy( +/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Length_Proxy( IVLCControl __RPC_FAR * This, /* [retval][out] */ int __RPC_FAR *seconds); @@ -668,7 +677,7 @@ void __RPC_STUB IVLCControl_playSlower_Stub( DWORD *_pdwStubPhase); -/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Volume_Proxy( +/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Volume_Proxy( IVLCControl __RPC_FAR * This, /* [retval][out] */ int __RPC_FAR *volume); @@ -680,7 +689,7 @@ void __RPC_STUB IVLCControl_get_Volume_Stub( DWORD *_pdwStubPhase); -/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Volume_Proxy( +/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Volume_Proxy( IVLCControl __RPC_FAR * This, /* [in] */ int volume); diff --git a/activex/main.cpp b/activex/main.cpp index 954b761170..1ad9f57248 100644 --- a/activex/main.cpp +++ b/activex/main.cpp @@ -23,9 +23,31 @@ #include "plugin.h" #include +#include +#include using namespace std; +#define COMDLLPATH "axvlc.dll" +#define THREADING_MODEL "Both" +#define COMPANY_STR "VideoLAN" +#define PROGRAM_STR "VLCPlugin" +#define VERSION_MAJOR_STR "1" +#define VERSION_MINOR_STR "0" +#define DESCRIPTION "VideoLAN VLC ActiveX Plugin" + +#define PROGID_STR COMPANY_STR"."PROGRAM_STR +#define VERS_PROGID_STR COMPANY_STR"."PROGRAM_STR"."VERSION_MAJOR_STR +#define VERSION_STR VERSION_MAJOR_STR"."VERSION_MINOR_STR + +#define GUID_STRLEN 39 + +/* +** MingW headers do not declare those +*/ +extern const CATID CATID_SafeForInitializing; +extern const CATID CATID_SafeForScripting; + static LONG i_class_ref= 0; static HINSTANCE h_instance= 0; @@ -49,13 +71,229 @@ STDAPI DllCanUnloadNow(VOID) return (0 == i_class_ref) ? S_OK: S_FALSE; }; -STDAPI DllRegisterServer(VOID) +static LPCTSTR TStrFromGUID(REFGUID clsid) { + LPOLESTR oleStr; + + if( FAILED(StringFromIID(clsid, &oleStr)) ) + return NULL; + + //check whether TCHAR and OLECHAR are both either ANSI or UNICODE + if( sizeof(TCHAR) == sizeof(OLECHAR) ) + return (LPCTSTR)oleStr; + + LPTSTR pct_CLSID = NULL; +#ifndef OLE2ANSI + size_t len = WideCharToMultiByte(CP_ACP, 0, oleStr, -1, NULL, 0, NULL, NULL); + if( len > 0 ) + { + pct_CLSID = (char *)CoTaskMemAlloc(len); + WideCharToMultiByte(CP_ACP, 0, oleStr, -1, pct_CLSID, len, NULL, NULL); + } +#else + size_t len = MutiByteToWideChar(CP_ACP, 0, oleStr, -1, NULL, 0); + if( len > 0 ) + { + clsidStr = (wchar_t *)CoTaskMemAlloc(len*sizeof(wchar_t)); + WideCharToMultiByte(CP_ACP, 0, oleStr, -1, pct_CLSID, len); + } +#endif + CoTaskMemFree(oleStr); + return pct_CLSID; +}; + +static HKEY keyCreate(HKEY parentKey, LPCTSTR keyName) { - return S_OK; + HKEY childKey; + if( ERROR_SUCCESS == RegCreateKeyEx(parentKey, keyName, 0, NULL, + REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &childKey, NULL) ) + { + return childKey; + } + return NULL; }; STDAPI DllUnregisterServer(VOID) { + // unregister type lib from the registry + UnRegisterTypeLib(LIBID_AXVLC, 1, 0, LOCALE_NEUTRAL, SYS_WIN32); + + // remove component categories we supports + ICatRegister *pcr; + if( SUCCEEDED(CoCreateInstance(CLSID_StdComponentCategoriesMgr, + NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr)) ) { + CATID implCategories[] = { + CATID_Control, + CATID_PersistsToPropertyBag, + CATID_SafeForInitializing, + CATID_SafeForScripting, + }; + + pcr->UnRegisterClassImplCategories(CLSID_VLCPlugin, + sizeof(implCategories)/sizeof(CATID), implCategories); + pcr->Release(); + } + + SHDeleteKey(HKEY_CLASSES_ROOT, TEXT(VERS_PROGID_STR)); + SHDeleteKey(HKEY_CLASSES_ROOT, TEXT(PROGID_STR)); + + LPCTSTR psz_CLSID = TStrFromGUID(CLSID_VLCPlugin); + + if( NULL == psz_CLSID ) + return E_OUTOFMEMORY; + + HKEY hClsIDKey; + if( ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, TEXT("CLSID"), 0, KEY_WRITE, &hClsIDKey) ) + { + SHDeleteKey(hClsIDKey, psz_CLSID); + RegCloseKey(hClsIDKey); + } + + return S_OK; +}; + +STDAPI DllRegisterServer(VOID) +{ + DllUnregisterServer(); + + LPCTSTR psz_CLSID = TStrFromGUID(CLSID_VLCPlugin); + + if( NULL == psz_CLSID ) + return E_OUTOFMEMORY; + + HKEY hBaseKey; + + if( ERROR_SUCCESS != RegOpenKeyEx(HKEY_CLASSES_ROOT, TEXT("CLSID"), 0, KEY_CREATE_SUB_KEY, &hBaseKey) ) + return E_FAIL; + + HKEY hClassKey = keyCreate(hBaseKey, psz_CLSID); + if( NULL != hClassKey ) + { + HKEY hSubKey; + + // default key value + RegSetValueEx(hClassKey, NULL, 0, REG_SZ, + (const BYTE*)DESCRIPTION, sizeof(DESCRIPTION)); + + // Control key value + hSubKey = keyCreate(hClassKey, TEXT("Control")); + RegCloseKey(hSubKey); + + // InprocServer32 key value + hSubKey = keyCreate(hClassKey, TEXT("InprocServer32")); + RegSetValueEx(hSubKey, NULL, 0, REG_SZ, + (const BYTE*)COMDLLPATH, sizeof(COMDLLPATH)); + RegSetValueEx(hSubKey, TEXT("ThreadingModel"), 0, REG_SZ, + (const BYTE*)THREADING_MODEL, sizeof(THREADING_MODEL)); + RegCloseKey(hSubKey); + + // MiscStatus key value + hSubKey = keyCreate(hClassKey, TEXT("MiscStatus\\1")); + RegSetValueEx(hSubKey, NULL, 0, REG_SZ, (const BYTE*)"131473", sizeof("131473")); + RegCloseKey(hSubKey); + + // Programmable key value + hSubKey = keyCreate(hClassKey, TEXT("Programmable")); + RegCloseKey(hSubKey); + + // ProgID key value + hSubKey = keyCreate(hClassKey, TEXT("ProgID")); + RegSetValueEx(hSubKey, NULL, 0, REG_SZ, + (const BYTE*)VERS_PROGID_STR, sizeof(VERS_PROGID_STR)); + RegCloseKey(hSubKey); + + // VersionIndependentProgID key value + hSubKey = keyCreate(hClassKey, TEXT("VersionIndependentProgID")); + RegSetValueEx(hSubKey, NULL, 0, REG_SZ, + (const BYTE*)PROGID_STR, sizeof(PROGID_STR)); + RegCloseKey(hSubKey); + + // Version key value + hSubKey = keyCreate(hClassKey, TEXT("Version")); + RegSetValueEx(hSubKey, NULL, 0, REG_SZ, + (const BYTE*)VERSION_STR, sizeof(VERSION_STR)); + RegCloseKey(hSubKey); + + // TypeLib key value + LPCTSTR psz_LIBID = TStrFromGUID(LIBID_AXVLC); + if( NULL != psz_LIBID ) + { + hSubKey = keyCreate(hClassKey, TEXT("TypeLib")); + RegSetValueEx(hSubKey, NULL, 0, REG_SZ, + (const BYTE*)psz_LIBID, sizeof(TCHAR)*GUID_STRLEN); + RegCloseKey(hSubKey); + } + RegCloseKey(hClassKey); + } + RegCloseKey(hBaseKey); + + hBaseKey = keyCreate(HKEY_CLASSES_ROOT, TEXT(PROGID_STR)); + if( NULL != hBaseKey ) + { + // default key value + RegSetValueEx(hBaseKey, NULL, 0, REG_SZ, + (const BYTE*)DESCRIPTION, sizeof(DESCRIPTION)); + + HKEY hSubKey = keyCreate(hBaseKey, TEXT("CLSID")); + if( NULL != hSubKey ) + { + // default key value + RegSetValueEx(hSubKey, NULL, 0, REG_SZ, + (const BYTE*)psz_CLSID, sizeof(TCHAR)*GUID_STRLEN); + + RegCloseKey(hSubKey); + } + hSubKey = keyCreate(hBaseKey, TEXT("CurVer")); + if( NULL != hSubKey ) + { + // default key value + RegSetValueEx(hSubKey, NULL, 0, REG_SZ, + (const BYTE*)VERS_PROGID_STR, sizeof(VERS_PROGID_STR)); + + RegCloseKey(hSubKey); + } + RegCloseKey(hBaseKey); + } + + hBaseKey = keyCreate(HKEY_CLASSES_ROOT, TEXT(VERS_PROGID_STR)); + if( NULL != hBaseKey ) + { + // default key value + RegSetValueEx(hBaseKey, NULL, 0, REG_SZ, + (const BYTE*)DESCRIPTION, sizeof(DESCRIPTION)); + + HKEY hSubKey = keyCreate(hBaseKey, TEXT("CLSID")); + if( NULL != hSubKey ) + { + // default key value + RegSetValueEx(hSubKey, NULL, 0, REG_SZ, + (const BYTE*)psz_CLSID, sizeof(TCHAR)*GUID_STRLEN); + + RegCloseKey(hSubKey); + } + RegCloseKey(hBaseKey); + } + + // indicate which component categories we support + ICatRegister *pcr; + if( SUCCEEDED(CoCreateInstance(CLSID_StdComponentCategoriesMgr, + NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr)) ) { + CATID implCategories[] = { + CATID_Control, + CATID_PersistsToPropertyBag, + CATID_SafeForInitializing, + CATID_SafeForScripting, + }; + + pcr->RegisterClassImplCategories(CLSID_VLCPlugin, + sizeof(implCategories)/sizeof(CATID), implCategories); + pcr->Release(); + } + + // register type lib into the registry + ITypeLib *typeLib; + if( SUCCEEDED(LoadTypeLibEx(OLESTR("")COMDLLPATH, REGKIND_REGISTER, &typeLib)) ) + typeLib->Release(); + return S_OK; }; @@ -64,8 +302,7 @@ STDAPI DllUnregisterServer(VOID) /* ** easier to debug an application than a DLL on cygwin GDB :) */ - -#include +#include STDAPI_(int) WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) { diff --git a/activex/oleobject.cpp b/activex/oleobject.cpp index 6089bbd2d1..750ac3ab5f 100644 --- a/activex/oleobject.cpp +++ b/activex/oleobject.cpp @@ -232,12 +232,20 @@ STDMETHODIMP VLCOleObject::GetMiscStatus(DWORD dwAspect, DWORD *pdwStatus) { if( NULL != pdwStatus ) return E_POINTER; - - *pdwStatus = OLEMISC_RECOMPOSEONRESIZE - | OLEMISC_CANTLINKINSIDE - | OLEMISC_INSIDEOUT - | OLEMISC_ACTIVATEWHENVISIBLE - | OLEMISC_SETCLIENTSITEFIRST; + + switch( dwAspect ) + { + case DVASPECT_CONTENT: + *pdwStatus = OLEMISC_RECOMPOSEONRESIZE + | OLEMISC_CANTLINKINSIDE + | OLEMISC_INSIDEOUT + | OLEMISC_ACTIVATEWHENVISIBLE + | OLEMISC_SETCLIENTSITEFIRST; + break; + default: + *pdwStatus = 0; + } + return S_OK; }; diff --git a/activex/persistpropbag.cpp b/activex/persistpropbag.cpp index 76c59411a9..2f13ada717 100644 --- a/activex/persistpropbag.cpp +++ b/activex/persistpropbag.cpp @@ -108,7 +108,7 @@ STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErr V_VT(&value) = VT_BOOL; if( S_OK == pPropBag->Read(OLESTR("showdisplay"), &value, pErrorLog) ) { - _p_instance->setShowDisplay(V_BOOL(&value) != VARIANT_FALSE); + _p_instance->setVisible(V_BOOL(&value) != VARIANT_FALSE); VariantClear(&value); } diff --git a/activex/plugin.cpp b/activex/plugin.cpp index 1d7cd02bfe..e178b3aa5d 100644 --- a/activex/plugin.cpp +++ b/activex/plugin.cpp @@ -229,7 +229,7 @@ VLCPlugin::VLCPlugin(VLCPluginClass *p_class) : _psz_src(NULL), _b_autostart(TRUE), _b_loopmode(FALSE), - _b_showdisplay(TRUE), + _b_visible(TRUE), _b_sendevents(TRUE), _i_vlc(0) { @@ -590,13 +590,14 @@ HRESULT VLCPlugin::onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprc SetWindowLongPtr(_videownd, GWLP_USERDATA, reinterpret_cast(this)); + if( getVisible() ) + ShowWindow(_inplacewnd, SW_SHOWNORMAL); + /* horrible cast there */ vlc_value_t val; val.i_int = reinterpret_cast(_videownd); VLC_VariableSet(_i_vlc, "drawable", val); - setVisible(_b_showdisplay); - if( NULL != _psz_src ) { // add target to playlist @@ -631,14 +632,12 @@ HRESULT VLCPlugin::onInPlaceDeactivate(void) return S_OK; }; -BOOL VLCPlugin::isVisible(void) -{ - return GetWindowLong(_inplacewnd, GWL_STYLE) & WS_VISIBLE; -}; - void VLCPlugin::setVisible(BOOL fVisible) { - ShowWindow(_inplacewnd, fVisible ? SW_SHOW : SW_HIDE); + _b_visible = fVisible; + if( isInPlaceActive() ) + ShowWindow(_inplacewnd, fVisible ? SW_SHOWNORMAL : SW_HIDE); + firePropChangedEvent(DISPID_Visible); }; void VLCPlugin::setFocus(BOOL fFocus) @@ -738,12 +737,20 @@ void VLCPlugin::onPositionChange(LPCRECT lprcPosRect, LPCRECT lprcClipRect) UpdateWindow(_videownd); }; +void VLCPlugin::firePropChangedEvent(DISPID dispid) +{ + if( _b_sendevents ) + { + vlcConnectionPointContainer->firePropChangedEvent(dispid); + } +}; + void VLCPlugin::fireOnPlayEvent(void) { if( _b_sendevents ) { DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0}; - vlcConnectionPointContainer->fireEvent(1, &dispparamsNoArgs); + vlcConnectionPointContainer->fireEvent(DISPID_PlayEvent, &dispparamsNoArgs); } }; @@ -752,7 +759,7 @@ void VLCPlugin::fireOnPauseEvent(void) if( _b_sendevents ) { DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0}; - vlcConnectionPointContainer->fireEvent(2, &dispparamsNoArgs); + vlcConnectionPointContainer->fireEvent(DISPID_PauseEvent, &dispparamsNoArgs); } }; @@ -761,7 +768,7 @@ void VLCPlugin::fireOnStopEvent(void) if( _b_sendevents ) { DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0}; - vlcConnectionPointContainer->fireEvent(3, &dispparamsNoArgs); + vlcConnectionPointContainer->fireEvent(DISPID_StopEvent, &dispparamsNoArgs); } }; diff --git a/activex/plugin.h b/activex/plugin.h index 7c01409f7f..cfbfba2624 100644 --- a/activex/plugin.h +++ b/activex/plugin.h @@ -79,8 +79,8 @@ public: STDMETHODIMP_(ULONG) Release(void); /* custom methods */ - HRESULT getTypeLib(ITypeLib **pTL) - { return LoadRegTypeLib(LIBID_AXVLC, 1, 0, LOCALE_USER_DEFAULT, pTL); }; + HRESULT getTypeLib(LCID lcid, ITypeLib **pTL) + { return LoadRegTypeLib(LIBID_AXVLC, 1, 0, lcid, pTL); }; REFCLSID getClassID(void) { return (REFCLSID)CLSID_VLCPlugin; }; REFIID getDispEventID(void) { return (REFIID)DIID_DVLCEvents; }; @@ -92,9 +92,6 @@ public: HRESULT onInPlaceDeactivate(void); HWND getInPlaceWindow(void) const { return _inplacewnd; }; - BOOL isVisible(void); - void setVisible(BOOL fVisible); - BOOL hasFocus(void); void setFocus(BOOL fFocus); @@ -113,15 +110,16 @@ public: VLC_VolumeMute(_i_vlc); } }; - void setShowDisplay(BOOL show) { _b_showdisplay = show; }; - BOOL getShowDisplay(void) { return _b_showdisplay; }; void setSendEvents(BOOL sendevents) { _b_sendevents = sendevents; }; + void setVisible(BOOL fVisible); + BOOL getVisible(void) { return _b_visible; }; // container events void onPositionChange(LPCRECT lprcPosRect, LPCRECT lprcClipRect); void onPaint(PAINTSTRUCT &ps, RECT &pr); // control events + void firePropChangedEvent(DISPID dispid); void fireOnPlayEvent(void); void fireOnPauseEvent(void); void fireOnStopEvent(void); @@ -160,7 +158,7 @@ private: char *_psz_src; BOOL _b_autostart; BOOL _b_loopmode; - BOOL _b_showdisplay; + BOOL _b_visible; BOOL _b_sendevents; int _i_vlc; }; diff --git a/activex/provideclassinfo.cpp b/activex/provideclassinfo.cpp index 83e082e209..4d71080f85 100644 --- a/activex/provideclassinfo.cpp +++ b/activex/provideclassinfo.cpp @@ -32,7 +32,7 @@ STDMETHODIMP VLCProvideClassInfo::GetClassInfo(ITypeInfo **ppTI) if( NULL == ppTI ) return E_POINTER; - HRESULT hr = _p_instance->getTypeLib(&p_typelib); + HRESULT hr = _p_instance->getTypeLib(LOCALE_NEUTRAL, &p_typelib); if( SUCCEEDED(hr) ) { hr = p_typelib->GetTypeInfoOfGuid(_p_instance->getClassID(), ppTI); diff --git a/activex/test.html b/activex/test.html index c6fbe92d9c..3cf2143855 100644 --- a/activex/test.html +++ b/activex/test.html @@ -17,7 +17,7 @@ MRL: - diff --git a/activex/vlccontrol.cpp b/activex/vlccontrol.cpp index 21e365333f..835f5d1166 100644 --- a/activex/vlccontrol.cpp +++ b/activex/vlccontrol.cpp @@ -38,7 +38,7 @@ HRESULT VLCControl::getTypeInfo(void) { ITypeLib *p_typelib; - HRESULT hr = _p_instance->getTypeLib(&p_typelib); + HRESULT hr = _p_instance->getTypeLib(LOCALE_USER_DEFAULT, &p_typelib); if( SUCCEEDED(hr) ) { hr = p_typelib->GetTypeInfoOfGuid(IID_IVLCControl, &_p_typeinfo); @@ -129,20 +129,14 @@ STDMETHODIMP VLCControl::get_Visible(VARIANT_BOOL *isVisible) if( NULL == isVisible ) return E_INVALIDARG; - if( _p_instance->isInPlaceActive() ) - *isVisible = _p_instance->isVisible() ? VARIANT_TRUE : VARIANT_FALSE; - else - *isVisible = _p_instance->getShowDisplay() ? VARIANT_TRUE : VARIANT_FALSE; + *isVisible = _p_instance->getVisible(); return NOERROR; }; STDMETHODIMP VLCControl::put_Visible(VARIANT_BOOL isVisible) { - if( _p_instance->isInPlaceActive() ) - _p_instance->setVisible(isVisible != VARIANT_FALSE); - else - _p_instance->setShowDisplay(isVisible != VARIANT_FALSE); + _p_instance->setVisible(isVisible != VARIANT_FALSE); return NOERROR; }; diff --git a/configure.ac b/configure.ac index 092cc494fa..72397dd173 100644 --- a/configure.ac +++ b/configure.ac @@ -4040,10 +4040,10 @@ if test "${enable_activex}" != "no" then if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin" then - AC_CHECK_PROG(MIDL, midl, :) + AC_CHECK_PROGS(MIDL, [midl widl], no) AC_CHECK_HEADERS(ole2.h olectl.h, [ VLC_ADD_CXXFLAGS([activex],[-fno-exceptions]) - VLC_ADD_LDFLAGS([activex],[-lole32 -loleaut32 -luuid]) + VLC_ADD_LDFLAGS([activex],[-lole32 -loleaut32 -luuid -lshlwapi]) AC_CHECK_HEADERS(objsafe.h, VLC_ADD_CXXFLAGS([activex],[-DHAVE_OBJSAFE_HEADER]) ) @@ -4054,7 +4054,7 @@ then fi fi AC_ARG_VAR(MIDL, [Microsoft IDL compiler (Win32 platform only)]) -AM_CONDITIONAL(HAS_MIDL_COMPILER, test -n "${MIDL}") +AM_CONDITIONAL(HAS_MIDL_COMPILER, test "${MIDL}" != "no") AM_CONDITIONAL(BUILD_ACTIVEX,${activex}) dnl -- 2.39.2