static LONG i_class_ref= 0;
static HINSTANCE h_instance= 0;
+HMODULE DllGetModule()
+{
+ return h_instance;
+};
+
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
HRESULT hr = CLASS_E_CLASSNOTAVAILABLE;
*ppv = NULL;
- if( CLSID_VLCPlugin2 == rclsid )
+ if( (CLSID_VLCPlugin == rclsid )
+ || ( CLSID_VLCPlugin2 == rclsid) )
{
VLCPluginClass *plugin = new VLCPluginClass(&i_class_ref, h_instance, rclsid);
hr = plugin->QueryInterface(riid, ppv);
HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc)
{
+ extern HMODULE DllGetModule();
+
if( ! isRunning() )
{
/*
{
if( i_type == REG_SZ )
{
- strcat( p_data, "\\vlc" );
- ppsz_argv[0] = p_data;
+ strcat( p_data, "\\plugins" );
+ ppsz_argv[ppsz_argc++] = "--plugin-path";
+ ppsz_argv[ppsz_argc++] = p_data;
}
}
RegCloseKey( h_key );
}
-#if 0
- ppsz_argv[0] = "C:\\cygwin\\home\\damienf\\vlc-trunk\\vlc";
-#endif
+ char p_path[MAX_PATH+1];
+ DWORD len = GetModuleFileNameA(DllGetModule(), p_path, sizeof(p_path));
+ if( len > 0 )
+ {
+ p_path[len] = '\0';
+ ppsz_argv[0] = p_path;
+ }
// make sure plugin isn't affected with VLC single instance mode
ppsz_argv[ppsz_argc++] = "--no-one-instance";