]> git.sesse.net Git - vlc/commitdiff
- miscelleanous fixes and improvements
authorDamien Fouilleul <damienf@videolan.org>
Thu, 17 Feb 2005 12:06:01 +0000 (12:06 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Thu, 17 Feb 2005 12:06:01 +0000 (12:06 +0000)
- self registration (Internet installation now possible)

16 files changed:
activex/Makefile.am
activex/README.TXT
activex/axvlc.idl
activex/axvlc.inf [new file with mode: 0644]
activex/axvlc.tlb
activex/axvlc_idl.c
activex/axvlc_idl.h
activex/main.cpp
activex/oleobject.cpp
activex/persistpropbag.cpp
activex/plugin.cpp
activex/plugin.h
activex/provideclassinfo.cpp
activex/test.html
activex/vlccontrol.cpp
configure.ac

index d89eaf25af03bba1665ce4ae4c2ddd24604ccecf..f77e21d1feca0c04b4bdf27a1d2ee89db061d0b3 100644 (file)
@@ -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
index 40bd005e0eb0a322591812959d546b47e4119cfe..677fe9271a4d8fcd6754d52f220b921b7406cdad 100644 (file)
@@ -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 <Damien dot Fouilleul at laposte dot net>
+
index 92f82a65b61f7664b5acaed71ffd12915af38c80..edf462b40ad3e64ee046b7e2c31b8133a5596d23 100644 (file)
@@ -34,15 +34,27 @@ library AXVLC
     dispinterface DVLCEvents;\r
 \r
     enum VLCPlaylistMode {\r
-        VLCPlayListInsert      =  1,\r
-        VLCPlayListReplace     =  2,\r
-        VLCPlayListAppend      =  4,\r
-        VLCPlayListGo          =  8,\r
-        VLCPlayListCheckInsert = 16\r
+        VLCPlayListInsert       =  1,\r
+        VLCPlayListReplace      =  2,\r
+        VLCPlayListAppend       =  4,\r
+        VLCPlayListGo           =  8,\r
+        VLCPlayListCheckInsert  = 16\r
     };\r
 \r
     // playlist target position\r
-    const int VLCPlayListEnd = -666;\r
+    const int VLCPlayListEnd    = -666;\r
+\r
+    // DISPID definitions\r
+    const int DISPID_Visible    = 1;\r
+    const int DISPID_Playing    = 2;\r
+    const int DISPID_Position   = 3;\r
+    const int DISPID_Time       = 4;\r
+    const int DISPID_Length     = 5;\r
+    const int DISPID_Volume     = 6;\r
+\r
+    const int DISPID_PlayEvent  = 1;\r
+    const int DISPID_PauseEvent = 2;\r
+    const int DISPID_StopEvent  = 3;\r
 \r
     [\r
       odl,\r
@@ -53,13 +65,14 @@ library AXVLC
       oleautomation\r
     ]\r
     interface IVLCControl : IDispatch {\r
+\r
         [id(0), bindable, defaultbind, propget, helpstring("Specifies current target in playlist")]\r
         HRESULT Value([out, retval] VARIANT* pvarValue);\r
         [id(0), bindable, defaultbind, propput, helpstring("Specifies current target in playlist")]\r
         HRESULT Value([in] VARIANT pvarValue);\r
-        [propget, bindable, helpstring("Shows or hides plugin.")]\r
+        [id(DISPID_Visible), propget, bindable, helpstring("Shows or hides plugin.")]\r
         HRESULT Visible([out, retval] VARIANT_BOOL* visible);\r
-        [propput, bindable, helpstring("Shows or hides plugin.")]\r
+        [id(DISPID_Visible), propput, bindable, helpstring("Shows or hides plugin.")]\r
         HRESULT Visible([in] VARIANT_BOOL visible);\r
         [helpstring("Play current target in playlist.")]\r
         HRESULT play();\r
@@ -67,31 +80,31 @@ library AXVLC
         HRESULT pause();\r
         [helpstring("Stop playback.")]\r
         HRESULT stop();\r
-        [propget, helpstring("Specifies whether VLC is playing.")]\r
+        [id(DISPID_Playing), bindable, propget, helpstring("Specifies whether VLC is playing.")]\r
         HRESULT Playing([out, retval] VARIANT_BOOL* isPlaying);\r
-        [propput, helpstring("Specifies whether VLC is playing.")]\r
+        [id(DISPID_Playing), bindable, propput, helpstring("Specifies whether VLC is playing.")]\r
         HRESULT Playing([in] VARIANT_BOOL isPlaying);\r
-        [propget, helpstring("Specifies playback position within current target in playlist, position is a relative value ranging from 0.0 to 1.0.")]\r
+        [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.")]\r
         HRESULT Position([out, retval] float* position);\r
-        [propput, helpstring("Specifies playback position within current target in playlist, position is a relative value ranging from 0.0 to 1.0.")]\r
+        [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.")]\r
         HRESULT Position([in] float position);\r
-        [propget, helpstring("Specifies playback time relative to the start of current target in playlist.")]\r
+        [id(DISPID_Time), bindable, propget, helpstring("Specifies playback time relative to the start of current target in playlist.")]\r
         HRESULT Time([out, retval] int* seconds);\r
-        [propput, helpstring("Specifies playback time relative to the start of current target in playlist.")]\r
+        [id(DISPID_Time), bindable, propput, helpstring("Specifies playback time relative to the start of current target in playlist.")]\r
         HRESULT Time([in] int seconds);\r
         [helpstring("Advance or backtrack playback time, relative to current time.")]\r
         HRESULT shuttle([in] int seconds);\r
         [helpstring("Switch between normal and fullscreen video.")]\r
         HRESULT fullscreen();\r
-        [propget, helpstring("Returns total length in seconds of current target in playlist, may be unknown.")]\r
+        [id(DISPID_Length), bindable, propget, helpstring("Returns total length in seconds of current target in playlist, may be unknown.")]\r
         HRESULT Length([out, retval] int* seconds);\r
         [helpstring("Increases playback speed, one of 1x, 2x, 4x, 8x.")]\r
         HRESULT playFaster();\r
         [helpstring("Decreases playback speed, one of 1x, 2x, 4x, 8x.")]\r
         HRESULT playSlower();\r
-        [propget, helpstring("Specifies playback sound volume, ranges from 0 to 200%.")]\r
+        [id(DISPID_Volume), bindable, propget, helpstring("Specifies playback sound volume, ranges from 0 to 200%.")]\r
         HRESULT Volume([out, retval] int* volume);\r
-        [propput, helpstring("Specifies playback sound volume, ranges from 0 to 200%.")]\r
+        [id(DISPID_Volume), bindable, propput, helpstring("Specifies playback sound volume, ranges from 0 to 200%.")]\r
         HRESULT Volume([in] int volume);\r
         [helpstring("Mute/unmute playback sound volume.")]\r
         HRESULT toggleMute();\r
@@ -125,11 +138,11 @@ library AXVLC
     dispinterface DVLCEvents {\r
         properties:\r
         methods:\r
-            [id(1), helpstring("Playback in progress")]\r
+            [id(DISPID_PlayEvent), helpstring("Playback in progress")]\r
             void Play();\r
-            [id(2), helpstring("Playback has paused")]\r
+            [id(DISPID_PauseEvent), helpstring("Playback has paused")]\r
             void Pause();\r
-            [id(3), helpstring("Playback has stopped")]\r
+            [id(DISPID_StopEvent), helpstring("Playback has stopped")]\r
             void Stop();\r
     };\r
 \r
diff --git a/activex/axvlc.inf b/activex/axvlc.inf
new file mode 100644 (file)
index 0000000..1f8e677
--- /dev/null
@@ -0,0 +1,11 @@
+[version]\r
+  signature="$CHICAGO$"\r
+  AdvancedINF=2.0\r
+[Add.Code]\r
+  axvlc.dll=axvlc.dll\r
+[axvlc.dll]\r
+  file-win32-x86=thiscab\r
+  clsid={E23FE9C6-778E-49d4-B537-38FCDE4887D8}\r
+  FileVersion=0,8,2,0\r
+  DestDir=10\r
+  RegisterServer=yes\r
index 2f995b2e4fb419f276084c56d14f006b17079df9..71e0409dbf70e7ae9081282b9fcf25a8d2f19f04 100755 (executable)
Binary files a/activex/axvlc.tlb and b/activex/axvlc.tlb differ
index 1d96f931a662fccb4a2d242f8f4217086871916b..ae90e8b779500d697a2e2360f4b3dd3942c2f31e 100644 (file)
@@ -1,25 +1,17 @@
-/*****************************************************************************\r
- * axvlc_idl.c: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
+/* this file contains the actual definitions of */\r
+/* the IIDs and CLSIDs */\r
 \r
+/* link this file in with the server and any clients */\r
+\r
+\r
+/* File created by MIDL compiler version 5.01.0164 */\r
+/* at Thu Feb 17 09:25:54 2005\r
+ */\r
+/* Compiler settings for axvlc.idl:\r
+    Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext\r
+    error checks: allocation ref bounds_check enum stub_data \r
+*/\r
+//@@MIDL_FILE_HEADING(  )\r
 #ifdef __cplusplus\r
 extern "C"{\r
 #endif \r
index b201f714474690f2566f615d755d66164a058ba1..545e0bdb2852c751da0ec5e37ea399ac18a2f123 100644 (file)
@@ -1,24 +1,15 @@
-/*****************************************************************************\r
- * axvlc_idl.h: ActiveX control for VLC\r
- *****************************************************************************\r
- * Copyright (C) 2005 VideoLAN\r
- *\r
- * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>\r
- *\r
- * This program is free software; you can redistribute it and/or modify\r
- * it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation; either version 2 of the License, or\r
- * (at your option) any later version.\r
- *\r
- * This program is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * along with this program; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.\r
- *****************************************************************************/\r
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */\r
+\r
+\r
+/* File created by MIDL compiler version 5.01.0164 */\r
+/* at Thu Feb 17 09:25:54 2005\r
+ */\r
+/* Compiler settings for axvlc.idl:\r
+    Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext\r
+    error checks: allocation ref bounds_check enum stub_data \r
+*/\r
+//@@MIDL_FILE_HEADING(  )\r
+\r
 \r
 /* verify that the <rpcndr.h> version is high enough to compile this file*/\r
 #ifndef __REQUIRED_RPCNDR_H_VERSION__\r
@@ -83,6 +74,24 @@ enum VLCPlaylistMode
     };\r
 #define        VLCPlayListEnd  ( -666 )\r
 \r
+#define        DISPID_Visible  ( 1 )\r
+\r
+#define        DISPID_Playing  ( 2 )\r
+\r
+#define        DISPID_Position ( 3 )\r
+\r
+#define        DISPID_Time     ( 4 )\r
+\r
+#define        DISPID_Length   ( 5 )\r
+\r
+#define        DISPID_Volume   ( 6 )\r
+\r
+#define        DISPID_PlayEvent        ( 1 )\r
+\r
+#define        DISPID_PauseEvent       ( 2 )\r
+\r
+#define        DISPID_StopEvent        ( 3 )\r
+\r
 \r
 EXTERN_C const IID LIBID_AXVLC;\r
 \r
@@ -107,10 +116,10 @@ EXTERN_C const IID IID_IVLCControl;
         virtual /* [helpstring][propput][defaultbind][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Value( \r
             /* [in] */ VARIANT pvarValue) = 0;\r
         \r
-        virtual /* [helpstring][bindable][propget] */ HRESULT STDMETHODCALLTYPE get_Visible( \r
+        virtual /* [helpstring][bindable][propget][id] */ HRESULT STDMETHODCALLTYPE get_Visible( \r
             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *visible) = 0;\r
         \r
-        virtual /* [helpstring][bindable][propput] */ HRESULT STDMETHODCALLTYPE put_Visible( \r
+        virtual /* [helpstring][bindable][propput][id] */ HRESULT STDMETHODCALLTYPE put_Visible( \r
             /* [in] */ VARIANT_BOOL visible) = 0;\r
         \r
         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE play( void) = 0;\r
@@ -119,22 +128,22 @@ EXTERN_C const IID IID_IVLCControl;
         \r
         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE stop( void) = 0;\r
         \r
-        virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Playing( \r
+        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Playing( \r
             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *isPlaying) = 0;\r
         \r
-        virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_Playing( \r
+        virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Playing( \r
             /* [in] */ VARIANT_BOOL isPlaying) = 0;\r
         \r
-        virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Position( \r
+        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Position( \r
             /* [retval][out] */ float __RPC_FAR *position) = 0;\r
         \r
-        virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_Position( \r
+        virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Position( \r
             /* [in] */ float position) = 0;\r
         \r
-        virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Time( \r
+        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Time( \r
             /* [retval][out] */ int __RPC_FAR *seconds) = 0;\r
         \r
-        virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_Time( \r
+        virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Time( \r
             /* [in] */ int seconds) = 0;\r
         \r
         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE shuttle( \r
@@ -142,17 +151,17 @@ EXTERN_C const IID IID_IVLCControl;
         \r
         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE fullscreen( void) = 0;\r
         \r
-        virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Length( \r
+        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Length( \r
             /* [retval][out] */ int __RPC_FAR *seconds) = 0;\r
         \r
         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playFaster( void) = 0;\r
         \r
         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE playSlower( void) = 0;\r
         \r
-        virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_Volume( \r
+        virtual /* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE get_Volume( \r
             /* [retval][out] */ int __RPC_FAR *volume) = 0;\r
         \r
-        virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_Volume( \r
+        virtual /* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE put_Volume( \r
             /* [in] */ int volume) = 0;\r
         \r
         virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE toggleMute( void) = 0;\r
@@ -234,11 +243,11 @@ EXTERN_C const IID IID_IVLCControl;
             IVLCControl __RPC_FAR * This,\r
             /* [in] */ VARIANT pvarValue);\r
         \r
-        /* [helpstring][bindable][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Visible )( \r
+        /* [helpstring][bindable][propget][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Visible )( \r
             IVLCControl __RPC_FAR * This,\r
             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *visible);\r
         \r
-        /* [helpstring][bindable][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Visible )( \r
+        /* [helpstring][bindable][propput][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Visible )( \r
             IVLCControl __RPC_FAR * This,\r
             /* [in] */ VARIANT_BOOL visible);\r
         \r
@@ -251,27 +260,27 @@ EXTERN_C const IID IID_IVLCControl;
         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *stop )( \r
             IVLCControl __RPC_FAR * This);\r
         \r
-        /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Playing )( \r
+        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Playing )( \r
             IVLCControl __RPC_FAR * This,\r
             /* [retval][out] */ VARIANT_BOOL __RPC_FAR *isPlaying);\r
         \r
-        /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Playing )( \r
+        /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Playing )( \r
             IVLCControl __RPC_FAR * This,\r
             /* [in] */ VARIANT_BOOL isPlaying);\r
         \r
-        /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Position )( \r
+        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Position )( \r
             IVLCControl __RPC_FAR * This,\r
             /* [retval][out] */ float __RPC_FAR *position);\r
         \r
-        /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Position )( \r
+        /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Position )( \r
             IVLCControl __RPC_FAR * This,\r
             /* [in] */ float position);\r
         \r
-        /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Time )( \r
+        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Time )( \r
             IVLCControl __RPC_FAR * This,\r
             /* [retval][out] */ int __RPC_FAR *seconds);\r
         \r
-        /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Time )( \r
+        /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Time )( \r
             IVLCControl __RPC_FAR * This,\r
             /* [in] */ int seconds);\r
         \r
@@ -282,7 +291,7 @@ EXTERN_C const IID IID_IVLCControl;
         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *fullscreen )( \r
             IVLCControl __RPC_FAR * This);\r
         \r
-        /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Length )( \r
+        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Length )( \r
             IVLCControl __RPC_FAR * This,\r
             /* [retval][out] */ int __RPC_FAR *seconds);\r
         \r
@@ -292,11 +301,11 @@ EXTERN_C const IID IID_IVLCControl;
         /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *playSlower )( \r
             IVLCControl __RPC_FAR * This);\r
         \r
-        /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Volume )( \r
+        /* [helpstring][propget][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Volume )( \r
             IVLCControl __RPC_FAR * This,\r
             /* [retval][out] */ int __RPC_FAR *volume);\r
         \r
-        /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Volume )( \r
+        /* [helpstring][propput][bindable][id] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *put_Volume )( \r
             IVLCControl __RPC_FAR * This,\r
             /* [in] */ int volume);\r
         \r
@@ -482,7 +491,7 @@ void __RPC_STUB IVLCControl_put_Value_Stub(
     DWORD *_pdwStubPhase);\r
 \r
 \r
-/* [helpstring][bindable][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Visible_Proxy( \r
+/* [helpstring][bindable][propget][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Visible_Proxy( \r
     IVLCControl __RPC_FAR * This,\r
     /* [retval][out] */ VARIANT_BOOL __RPC_FAR *visible);\r
 \r
@@ -494,7 +503,7 @@ void __RPC_STUB IVLCControl_get_Visible_Stub(
     DWORD *_pdwStubPhase);\r
 \r
 \r
-/* [helpstring][bindable][propput] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Visible_Proxy( \r
+/* [helpstring][bindable][propput][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Visible_Proxy( \r
     IVLCControl __RPC_FAR * This,\r
     /* [in] */ VARIANT_BOOL visible);\r
 \r
@@ -539,7 +548,7 @@ void __RPC_STUB IVLCControl_stop_Stub(
     DWORD *_pdwStubPhase);\r
 \r
 \r
-/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Playing_Proxy( \r
+/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Playing_Proxy( \r
     IVLCControl __RPC_FAR * This,\r
     /* [retval][out] */ VARIANT_BOOL __RPC_FAR *isPlaying);\r
 \r
@@ -551,7 +560,7 @@ void __RPC_STUB IVLCControl_get_Playing_Stub(
     DWORD *_pdwStubPhase);\r
 \r
 \r
-/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Playing_Proxy( \r
+/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Playing_Proxy( \r
     IVLCControl __RPC_FAR * This,\r
     /* [in] */ VARIANT_BOOL isPlaying);\r
 \r
@@ -563,7 +572,7 @@ void __RPC_STUB IVLCControl_put_Playing_Stub(
     DWORD *_pdwStubPhase);\r
 \r
 \r
-/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Position_Proxy( \r
+/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Position_Proxy( \r
     IVLCControl __RPC_FAR * This,\r
     /* [retval][out] */ float __RPC_FAR *position);\r
 \r
@@ -575,7 +584,7 @@ void __RPC_STUB IVLCControl_get_Position_Stub(
     DWORD *_pdwStubPhase);\r
 \r
 \r
-/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Position_Proxy( \r
+/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Position_Proxy( \r
     IVLCControl __RPC_FAR * This,\r
     /* [in] */ float position);\r
 \r
@@ -587,7 +596,7 @@ void __RPC_STUB IVLCControl_put_Position_Stub(
     DWORD *_pdwStubPhase);\r
 \r
 \r
-/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Time_Proxy( \r
+/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Time_Proxy( \r
     IVLCControl __RPC_FAR * This,\r
     /* [retval][out] */ int __RPC_FAR *seconds);\r
 \r
@@ -599,7 +608,7 @@ void __RPC_STUB IVLCControl_get_Time_Stub(
     DWORD *_pdwStubPhase);\r
 \r
 \r
-/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Time_Proxy( \r
+/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Time_Proxy( \r
     IVLCControl __RPC_FAR * This,\r
     /* [in] */ int seconds);\r
 \r
@@ -634,7 +643,7 @@ void __RPC_STUB IVLCControl_fullscreen_Stub(
     DWORD *_pdwStubPhase);\r
 \r
 \r
-/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Length_Proxy( \r
+/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Length_Proxy( \r
     IVLCControl __RPC_FAR * This,\r
     /* [retval][out] */ int __RPC_FAR *seconds);\r
 \r
@@ -668,7 +677,7 @@ void __RPC_STUB IVLCControl_playSlower_Stub(
     DWORD *_pdwStubPhase);\r
 \r
 \r
-/* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Volume_Proxy( \r
+/* [helpstring][propget][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_get_Volume_Proxy( \r
     IVLCControl __RPC_FAR * This,\r
     /* [retval][out] */ int __RPC_FAR *volume);\r
 \r
@@ -680,7 +689,7 @@ void __RPC_STUB IVLCControl_get_Volume_Stub(
     DWORD *_pdwStubPhase);\r
 \r
 \r
-/* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Volume_Proxy( \r
+/* [helpstring][propput][bindable][id] */ HRESULT STDMETHODCALLTYPE IVLCControl_put_Volume_Proxy( \r
     IVLCControl __RPC_FAR * This,\r
     /* [in] */ int volume);\r
 \r
index 954b7611707ef8c2627cb2eab83839c27b27bc9a..1ad9f57248357af3d7dad6fda701105d6fa0f148 100644 (file)
 #include "plugin.h"\r
 \r
 #include <comcat.h>\r
+#include <windows.h>\r
+#include <shlwapi.h>\r
 \r
 using namespace std;\r
 \r
+#define COMDLLPATH   "axvlc.dll"\r
+#define THREADING_MODEL "Both"\r
+#define COMPANY_STR "VideoLAN"\r
+#define PROGRAM_STR "VLCPlugin"\r
+#define VERSION_MAJOR_STR "1"\r
+#define VERSION_MINOR_STR "0"\r
+#define DESCRIPTION "VideoLAN VLC ActiveX Plugin"\r
+\r
+#define PROGID_STR COMPANY_STR"."PROGRAM_STR\r
+#define VERS_PROGID_STR COMPANY_STR"."PROGRAM_STR"."VERSION_MAJOR_STR\r
+#define VERSION_STR VERSION_MAJOR_STR"."VERSION_MINOR_STR\r
+\r
+#define GUID_STRLEN 39\r
+\r
+/*\r
+** MingW headers do not declare those\r
+*/\r
+extern const CATID CATID_SafeForInitializing;\r
+extern const CATID CATID_SafeForScripting;\r
+\r
 static LONG i_class_ref= 0;\r
 static HINSTANCE h_instance= 0;\r
 \r
@@ -49,13 +71,229 @@ STDAPI DllCanUnloadNow(VOID)
     return (0 == i_class_ref) ? S_OK: S_FALSE;\r
 };\r
 \r
-STDAPI DllRegisterServer(VOID)\r
+static LPCTSTR TStrFromGUID(REFGUID clsid) {\r
+    LPOLESTR oleStr;\r
+\r
+    if( FAILED(StringFromIID(clsid, &oleStr)) )\r
+        return NULL;\r
+\r
+    //check whether TCHAR and OLECHAR are both either ANSI or UNICODE\r
+    if( sizeof(TCHAR) == sizeof(OLECHAR) )\r
+        return (LPCTSTR)oleStr;\r
+\r
+    LPTSTR pct_CLSID = NULL;\r
+#ifndef OLE2ANSI\r
+    size_t len = WideCharToMultiByte(CP_ACP, 0, oleStr, -1, NULL, 0, NULL, NULL);\r
+    if( len > 0 )\r
+    {\r
+        pct_CLSID = (char *)CoTaskMemAlloc(len);\r
+        WideCharToMultiByte(CP_ACP, 0, oleStr, -1, pct_CLSID, len, NULL, NULL);\r
+    }\r
+#else\r
+    size_t len = MutiByteToWideChar(CP_ACP, 0, oleStr, -1, NULL, 0);\r
+    if( len > 0 )\r
+    {\r
+        clsidStr = (wchar_t *)CoTaskMemAlloc(len*sizeof(wchar_t));\r
+        WideCharToMultiByte(CP_ACP, 0, oleStr, -1, pct_CLSID, len);\r
+    }\r
+#endif\r
+    CoTaskMemFree(oleStr);\r
+    return pct_CLSID;\r
+};\r
+\r
+static HKEY keyCreate(HKEY parentKey, LPCTSTR keyName)\r
 {\r
-    return S_OK;\r
+    HKEY childKey;\r
+    if( ERROR_SUCCESS == RegCreateKeyEx(parentKey, keyName, 0, NULL,\r
+                REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &childKey, NULL) )\r
+    {\r
+        return childKey;\r
+    }\r
+    return NULL;\r
 };\r
 \r
 STDAPI DllUnregisterServer(VOID)\r
 {\r
+    // unregister type lib from the registry\r
+    UnRegisterTypeLib(LIBID_AXVLC, 1, 0, LOCALE_NEUTRAL, SYS_WIN32);\r
+\r
+    // remove component categories we supports\r
+    ICatRegister *pcr;\r
+    if( SUCCEEDED(CoCreateInstance(CLSID_StdComponentCategoriesMgr, \r
+            NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr)) ) {\r
+        CATID implCategories[] = {\r
+            CATID_Control,\r
+            CATID_PersistsToPropertyBag,\r
+            CATID_SafeForInitializing,\r
+            CATID_SafeForScripting,\r
+        };\r
+\r
+        pcr->UnRegisterClassImplCategories(CLSID_VLCPlugin,\r
+                sizeof(implCategories)/sizeof(CATID), implCategories);\r
+        pcr->Release();\r
+    }\r
+\r
+    SHDeleteKey(HKEY_CLASSES_ROOT, TEXT(VERS_PROGID_STR));\r
+    SHDeleteKey(HKEY_CLASSES_ROOT, TEXT(PROGID_STR));\r
+\r
+    LPCTSTR psz_CLSID = TStrFromGUID(CLSID_VLCPlugin);\r
+\r
+    if( NULL == psz_CLSID )\r
+        return E_OUTOFMEMORY;\r
+\r
+    HKEY hClsIDKey;\r
+    if( ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, TEXT("CLSID"), 0, KEY_WRITE, &hClsIDKey) )\r
+    {\r
+        SHDeleteKey(hClsIDKey, psz_CLSID);\r
+        RegCloseKey(hClsIDKey);\r
+    }\r
+\r
+    return S_OK;\r
+};\r
+\r
+STDAPI DllRegisterServer(VOID)\r
+{\r
+    DllUnregisterServer();\r
+\r
+    LPCTSTR psz_CLSID = TStrFromGUID(CLSID_VLCPlugin);\r
+\r
+    if( NULL == psz_CLSID )\r
+        return E_OUTOFMEMORY;\r
+\r
+    HKEY hBaseKey;\r
+\r
+    if( ERROR_SUCCESS != RegOpenKeyEx(HKEY_CLASSES_ROOT, TEXT("CLSID"), 0, KEY_CREATE_SUB_KEY, &hBaseKey) )\r
+        return E_FAIL;\r
+\r
+    HKEY hClassKey = keyCreate(hBaseKey, psz_CLSID);\r
+    if( NULL != hClassKey )\r
+    {\r
+        HKEY hSubKey;\r
+\r
+        // default key value\r
+        RegSetValueEx(hClassKey, NULL, 0, REG_SZ,\r
+                (const BYTE*)DESCRIPTION, sizeof(DESCRIPTION));\r
+\r
+        // Control key value\r
+        hSubKey = keyCreate(hClassKey, TEXT("Control"));\r
+        RegCloseKey(hSubKey);\r
+\r
+        // InprocServer32 key value\r
+        hSubKey = keyCreate(hClassKey, TEXT("InprocServer32"));\r
+        RegSetValueEx(hSubKey, NULL, 0, REG_SZ,\r
+                (const BYTE*)COMDLLPATH, sizeof(COMDLLPATH));\r
+        RegSetValueEx(hSubKey, TEXT("ThreadingModel"), 0, REG_SZ,\r
+                (const BYTE*)THREADING_MODEL, sizeof(THREADING_MODEL));\r
+        RegCloseKey(hSubKey);\r
+\r
+        // MiscStatus key value\r
+        hSubKey = keyCreate(hClassKey, TEXT("MiscStatus\\1"));\r
+        RegSetValueEx(hSubKey, NULL, 0, REG_SZ, (const BYTE*)"131473", sizeof("131473"));\r
+        RegCloseKey(hSubKey);\r
+\r
+        // Programmable key value\r
+        hSubKey = keyCreate(hClassKey, TEXT("Programmable"));\r
+        RegCloseKey(hSubKey);\r
+\r
+        // ProgID key value\r
+        hSubKey = keyCreate(hClassKey, TEXT("ProgID"));\r
+        RegSetValueEx(hSubKey, NULL, 0, REG_SZ, \r
+                (const BYTE*)VERS_PROGID_STR, sizeof(VERS_PROGID_STR));\r
+        RegCloseKey(hSubKey);\r
+\r
+        // VersionIndependentProgID key value\r
+        hSubKey = keyCreate(hClassKey, TEXT("VersionIndependentProgID"));\r
+        RegSetValueEx(hSubKey, NULL, 0, REG_SZ, \r
+                (const BYTE*)PROGID_STR, sizeof(PROGID_STR));\r
+        RegCloseKey(hSubKey);\r
+\r
+        // Version key value\r
+        hSubKey = keyCreate(hClassKey, TEXT("Version"));\r
+        RegSetValueEx(hSubKey, NULL, 0, REG_SZ,\r
+                (const BYTE*)VERSION_STR, sizeof(VERSION_STR));\r
+        RegCloseKey(hSubKey);\r
+\r
+        // TypeLib key value\r
+        LPCTSTR psz_LIBID = TStrFromGUID(LIBID_AXVLC);\r
+        if( NULL != psz_LIBID )\r
+        {\r
+            hSubKey = keyCreate(hClassKey, TEXT("TypeLib"));\r
+            RegSetValueEx(hSubKey, NULL, 0, REG_SZ,\r
+                    (const BYTE*)psz_LIBID, sizeof(TCHAR)*GUID_STRLEN);\r
+            RegCloseKey(hSubKey);\r
+        }\r
+        RegCloseKey(hClassKey);\r
+    }\r
+    RegCloseKey(hBaseKey);\r
+\r
+    hBaseKey = keyCreate(HKEY_CLASSES_ROOT, TEXT(PROGID_STR));\r
+    if( NULL != hBaseKey )\r
+    {\r
+        // default key value\r
+        RegSetValueEx(hBaseKey, NULL, 0, REG_SZ,\r
+                (const BYTE*)DESCRIPTION, sizeof(DESCRIPTION));\r
+\r
+        HKEY hSubKey = keyCreate(hBaseKey, TEXT("CLSID"));\r
+        if( NULL != hSubKey )\r
+        {\r
+            // default key value\r
+            RegSetValueEx(hSubKey, NULL, 0, REG_SZ,\r
+                    (const BYTE*)psz_CLSID, sizeof(TCHAR)*GUID_STRLEN);\r
+\r
+            RegCloseKey(hSubKey);\r
+        }\r
+        hSubKey = keyCreate(hBaseKey, TEXT("CurVer"));\r
+        if( NULL != hSubKey )\r
+        {\r
+            // default key value\r
+            RegSetValueEx(hSubKey, NULL, 0, REG_SZ,\r
+                    (const BYTE*)VERS_PROGID_STR, sizeof(VERS_PROGID_STR));\r
+\r
+            RegCloseKey(hSubKey);\r
+        }\r
+        RegCloseKey(hBaseKey);\r
+    }\r
+\r
+    hBaseKey = keyCreate(HKEY_CLASSES_ROOT, TEXT(VERS_PROGID_STR));\r
+    if( NULL != hBaseKey )\r
+    {\r
+        // default key value\r
+        RegSetValueEx(hBaseKey, NULL, 0, REG_SZ,\r
+                (const BYTE*)DESCRIPTION, sizeof(DESCRIPTION));\r
+\r
+        HKEY hSubKey = keyCreate(hBaseKey, TEXT("CLSID"));\r
+        if( NULL != hSubKey )\r
+        {\r
+            // default key value\r
+            RegSetValueEx(hSubKey, NULL, 0, REG_SZ,\r
+                    (const BYTE*)psz_CLSID, sizeof(TCHAR)*GUID_STRLEN);\r
+\r
+            RegCloseKey(hSubKey);\r
+        }\r
+        RegCloseKey(hBaseKey);\r
+    }\r
+\r
+    // indicate which component categories we support\r
+    ICatRegister *pcr;\r
+    if( SUCCEEDED(CoCreateInstance(CLSID_StdComponentCategoriesMgr, \r
+            NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr)) ) {\r
+        CATID implCategories[] = {\r
+            CATID_Control,\r
+            CATID_PersistsToPropertyBag,\r
+            CATID_SafeForInitializing,\r
+            CATID_SafeForScripting,\r
+        };\r
+\r
+        pcr->RegisterClassImplCategories(CLSID_VLCPlugin,\r
+                sizeof(implCategories)/sizeof(CATID), implCategories);\r
+        pcr->Release();\r
+    }\r
+\r
+    // register type lib into the registry\r
+    ITypeLib *typeLib;\r
+    if( SUCCEEDED(LoadTypeLibEx(OLESTR("")COMDLLPATH, REGKIND_REGISTER, &typeLib)) )\r
+        typeLib->Release();\r
+\r
     return S_OK;\r
 };\r
 \r
@@ -64,8 +302,7 @@ STDAPI DllUnregisterServer(VOID)
 /*\r
 ** easier to debug an application than a DLL on cygwin GDB :)\r
 */\r
-\r
-#include <iostream>\r
+#include <stream.h>\r
 \r
 STDAPI_(int) WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)\r
 {\r
index 6089bbd2d1e0d3d8ebec8498c5cc67af1d3bd804..750ac3ab5f011d9d0acaeba5594f2585a92e69f9 100644 (file)
@@ -232,12 +232,20 @@ STDMETHODIMP VLCOleObject::GetMiscStatus(DWORD dwAspect, DWORD *pdwStatus)
 {\r
     if( NULL != pdwStatus )\r
         return E_POINTER;\r
\r
-    *pdwStatus = OLEMISC_RECOMPOSEONRESIZE\r
-        | OLEMISC_CANTLINKINSIDE\r
-        | OLEMISC_INSIDEOUT\r
-        | OLEMISC_ACTIVATEWHENVISIBLE\r
-        | OLEMISC_SETCLIENTSITEFIRST;\r
+\r
+    switch( dwAspect )\r
+    {\r
+        case DVASPECT_CONTENT:\r
+            *pdwStatus = OLEMISC_RECOMPOSEONRESIZE\r
+                | OLEMISC_CANTLINKINSIDE\r
+                | OLEMISC_INSIDEOUT\r
+                | OLEMISC_ACTIVATEWHENVISIBLE\r
+                | OLEMISC_SETCLIENTSITEFIRST;\r
+            break;\r
+        default:\r
+            *pdwStatus = 0;\r
+    }\r
+\r
     return S_OK;\r
 };\r
 \r
index 76c59411a9888908653e4595ef274cb105510a47..2f13ada71796ff8c8a5ef9ff39da4ea10a92743d 100644 (file)
@@ -108,7 +108,7 @@ STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErr
     V_VT(&value) = VT_BOOL;\r
     if( S_OK == pPropBag->Read(OLESTR("showdisplay"), &value, pErrorLog) )\r
     {\r
-        _p_instance->setShowDisplay(V_BOOL(&value) != VARIANT_FALSE);\r
+        _p_instance->setVisible(V_BOOL(&value) != VARIANT_FALSE);\r
         VariantClear(&value);\r
     }\r
 \r
index 1d7cd02bfe909fd7dde332c53d6464217f5b29ea..e178b3aa5d50c87065d41ed7b91a0c732a37de10 100644 (file)
@@ -229,7 +229,7 @@ VLCPlugin::VLCPlugin(VLCPluginClass *p_class) :
     _psz_src(NULL),\r
     _b_autostart(TRUE),\r
     _b_loopmode(FALSE),\r
-    _b_showdisplay(TRUE),\r
+    _b_visible(TRUE),\r
     _b_sendevents(TRUE),\r
     _i_vlc(0)\r
 {\r
@@ -590,13 +590,14 @@ HRESULT VLCPlugin::onActivateInPlace(LPMSG lpMesg, HWND hwndParent, LPCRECT lprc
 \r
     SetWindowLongPtr(_videownd, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this));\r
 \r
+    if( getVisible() )\r
+        ShowWindow(_inplacewnd, SW_SHOWNORMAL);\r
+\r
     /* horrible cast there */\r
     vlc_value_t val;\r
     val.i_int = reinterpret_cast<int>(_videownd);\r
     VLC_VariableSet(_i_vlc, "drawable", val);\r
 \r
-    setVisible(_b_showdisplay);\r
-\r
     if( NULL != _psz_src )\r
     {\r
         // add target to playlist\r
@@ -631,14 +632,12 @@ HRESULT VLCPlugin::onInPlaceDeactivate(void)
     return S_OK;\r
 };\r
 \r
-BOOL VLCPlugin::isVisible(void)\r
-{\r
-    return GetWindowLong(_inplacewnd, GWL_STYLE) & WS_VISIBLE;\r
-};\r
-\r
 void VLCPlugin::setVisible(BOOL fVisible)\r
 {\r
-    ShowWindow(_inplacewnd, fVisible ? SW_SHOW : SW_HIDE);\r
+    _b_visible = fVisible;\r
+    if( isInPlaceActive() )\r
+        ShowWindow(_inplacewnd, fVisible ? SW_SHOWNORMAL : SW_HIDE);\r
+    firePropChangedEvent(DISPID_Visible);\r
 };\r
 \r
 void VLCPlugin::setFocus(BOOL fFocus)\r
@@ -738,12 +737,20 @@ void VLCPlugin::onPositionChange(LPCRECT lprcPosRect, LPCRECT lprcClipRect)
     UpdateWindow(_videownd);\r
 };\r
 \r
+void VLCPlugin::firePropChangedEvent(DISPID dispid)\r
+{\r
+    if( _b_sendevents )\r
+    {\r
+        vlcConnectionPointContainer->firePropChangedEvent(dispid); \r
+    }\r
+};\r
+\r
 void VLCPlugin::fireOnPlayEvent(void)\r
 {\r
     if( _b_sendevents )\r
     {\r
         DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};\r
-        vlcConnectionPointContainer->fireEvent(1, &dispparamsNoArgs); \r
+        vlcConnectionPointContainer->fireEvent(DISPID_PlayEvent, &dispparamsNoArgs); \r
     }\r
 };\r
 \r
@@ -752,7 +759,7 @@ void VLCPlugin::fireOnPauseEvent(void)
     if( _b_sendevents )\r
     {\r
         DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};\r
-        vlcConnectionPointContainer->fireEvent(2, &dispparamsNoArgs); \r
+        vlcConnectionPointContainer->fireEvent(DISPID_PauseEvent, &dispparamsNoArgs); \r
     }\r
 };\r
 \r
@@ -761,7 +768,7 @@ void VLCPlugin::fireOnStopEvent(void)
     if( _b_sendevents )\r
     {\r
         DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};\r
-        vlcConnectionPointContainer->fireEvent(3, &dispparamsNoArgs); \r
+        vlcConnectionPointContainer->fireEvent(DISPID_StopEvent, &dispparamsNoArgs); \r
     }\r
 };\r
 \r
index 7c01409f7fc14405039df1100ddf3d07a2545421..cfbfba26248f58270ed7b98ff31c64265c25d034 100644 (file)
@@ -79,8 +79,8 @@ public:
     STDMETHODIMP_(ULONG) Release(void);\r
 \r
     /* custom methods */\r
-    HRESULT getTypeLib(ITypeLib **pTL)\r
-        { return LoadRegTypeLib(LIBID_AXVLC, 1, 0, LOCALE_USER_DEFAULT, pTL); };\r
+    HRESULT getTypeLib(LCID lcid, ITypeLib **pTL)\r
+        { return LoadRegTypeLib(LIBID_AXVLC, 1, 0, lcid, pTL); };\r
     REFCLSID getClassID(void) { return (REFCLSID)CLSID_VLCPlugin; };\r
     REFIID getDispEventID(void) { return (REFIID)DIID_DVLCEvents; };\r
 \r
@@ -92,9 +92,6 @@ public:
     HRESULT onInPlaceDeactivate(void);\r
     HWND getInPlaceWindow(void) const { return _inplacewnd; };\r
 \r
-    BOOL isVisible(void);\r
-    void setVisible(BOOL fVisible);\r
-\r
     BOOL hasFocus(void);\r
     void setFocus(BOOL fFocus);\r
 \r
@@ -113,15 +110,16 @@ public:
             VLC_VolumeMute(_i_vlc);\r
         }\r
     };\r
-    void setShowDisplay(BOOL show) { _b_showdisplay = show; };\r
-    BOOL getShowDisplay(void) { return _b_showdisplay; };\r
     void setSendEvents(BOOL sendevents) { _b_sendevents = sendevents; };\r
+    void setVisible(BOOL fVisible);\r
+    BOOL getVisible(void) { return _b_visible; };\r
 \r
     // container events\r
     void onPositionChange(LPCRECT lprcPosRect, LPCRECT lprcClipRect);\r
     void onPaint(PAINTSTRUCT &ps, RECT &pr);\r
 \r
     // control events\r
+    void firePropChangedEvent(DISPID dispid);\r
     void fireOnPlayEvent(void);\r
     void fireOnPauseEvent(void);\r
     void fireOnStopEvent(void);\r
@@ -160,7 +158,7 @@ private:
     char *_psz_src;\r
     BOOL _b_autostart;\r
     BOOL _b_loopmode;\r
-    BOOL _b_showdisplay;\r
+    BOOL _b_visible;\r
     BOOL _b_sendevents;\r
     int _i_vlc;\r
 };\r
index 83e082e20952d040167a4cba281c4499268c0a8f..4d71080f85890b6f14dd2f61652e39c005ffd6df 100644 (file)
@@ -32,7 +32,7 @@ STDMETHODIMP VLCProvideClassInfo::GetClassInfo(ITypeInfo **ppTI)
     if( NULL == ppTI )\r
         return E_POINTER;\r
 \r
-    HRESULT hr = _p_instance->getTypeLib(&p_typelib);\r
+    HRESULT hr = _p_instance->getTypeLib(LOCALE_NEUTRAL, &p_typelib);\r
     if( SUCCEEDED(hr) )\r
     {\r
         hr = p_typelib->GetTypeInfoOfGuid(_p_instance->getClassID(), ppTI);\r
index c6fbe92d9c1357656a5a235eb5cee0836e6777b0..3cf21438557a30de7771e0c95d5a6d9cfee6a457 100644 (file)
@@ -17,7 +17,7 @@ MRL:
 <INPUT type=submit value="Go" onClick="go(targetTextField.value);">
 </TD></TR>
 <TR><TD>
-<OBJECT classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8"
+<OBJECT classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8" codebase="axvlc.cab"
         width="640" height="480" id="vlc" events="True">
 <param name="Src" value="" />
 <param name="ShowDisplay" value="True" />
index 21e365333fdae299902ffb2f244ef3aa572cefb4..835f5d11663fd55612d729bc2e0c2eadfdcf90f8 100644 (file)
@@ -38,7 +38,7 @@ HRESULT VLCControl::getTypeInfo(void)
     {\r
         ITypeLib *p_typelib;\r
 \r
-        HRESULT hr = _p_instance->getTypeLib(&p_typelib);\r
+        HRESULT hr = _p_instance->getTypeLib(LOCALE_USER_DEFAULT, &p_typelib);\r
         if( SUCCEEDED(hr) )\r
         {\r
             hr = p_typelib->GetTypeInfoOfGuid(IID_IVLCControl, &_p_typeinfo);\r
@@ -129,20 +129,14 @@ STDMETHODIMP VLCControl::get_Visible(VARIANT_BOOL *isVisible)
     if( NULL == isVisible )\r
         return E_INVALIDARG;\r
 \r
-    if( _p_instance->isInPlaceActive() )\r
-        *isVisible = _p_instance->isVisible() ? VARIANT_TRUE : VARIANT_FALSE;\r
-    else\r
-        *isVisible =  _p_instance->getShowDisplay() ? VARIANT_TRUE : VARIANT_FALSE;\r
+    *isVisible = _p_instance->getVisible();\r
 \r
     return NOERROR;\r
 };\r
         \r
 STDMETHODIMP VLCControl::put_Visible(VARIANT_BOOL isVisible)\r
 {\r
-    if( _p_instance->isInPlaceActive() )\r
-        _p_instance->setVisible(isVisible != VARIANT_FALSE);\r
-    else\r
-        _p_instance->setShowDisplay(isVisible != VARIANT_FALSE);\r
+    _p_instance->setVisible(isVisible != VARIANT_FALSE);\r
 \r
     return NOERROR;\r
 };\r
index 092cc494fa41ebd625c2c34d94de4c7208ccbf1d..72397dd173bfdc373faa8d6144da301770c23deb 100644 (file)
@@ -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