/*****************************************************************************
* main.cpp: ActiveX control for VLC
*****************************************************************************
- * Copyright (C) 2005 VideoLAN
+ * Copyright (C) 2005 the VideoLAN team
*
* Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
*
*
* 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.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "plugin.h"
if( len > 0 )
{
clsidStr = (wchar_t *)CoTaskMemAlloc(len*sizeof(wchar_t));
- WideCharToMultiByte(CP_ACP, 0, oleStr, -1, pct_CLSID, len);
+ MultiByteToWideChar(CP_ACP, 0, oleStr, -1, pct_CLSID, len);
}
#endif
CoTaskMemFree(oleStr);
hSubKey = keyCreate(hClassKey, TEXT("Control"));
RegCloseKey(hSubKey);
+ // Insertable key value
+ //hSubKey = keyCreate(hClassKey, TEXT("Insertable"));
+ //RegCloseKey(hSubKey);
+
+ // ToolboxBitmap32 key value
+ hSubKey = keyCreate(hClassKey, TEXT("ToolboxBitmap32"));
+ strcpy(DllPath+DllPathLen, ",1");
+ RegSetValueEx(hSubKey, NULL, 0, REG_SZ,
+ (const BYTE*)DllPath, DllPathLen+2);
+ DllPath[DllPathLen] = '\0';
+ RegCloseKey(hSubKey);
+
#ifdef BUILD_LOCALSERVER
// LocalServer32 key value
hSubKey = keyCreate(hClassKey, TEXT("LocalServer32"));
RegCloseKey(hSubKey);
}
+ //hSubKey = keyCreate(hBaseKey, TEXT("Insertable"));
+ //RegCloseKey(hSubKey);
+
RegCloseKey(hBaseKey);
}
// register type lib into the registry
ITypeLib *typeLib;
+
+#ifdef BUILD_LOCALSERVER
+ // replace .exe by .tlb
+ strcpy(DllPath+DllPathLen-4, ".tlb");
+#endif
+
#ifndef OLE2ANSI
size_t typeLibPathLen = MultiByteToWideChar(CP_ACP, 0, DllPath, -1, NULL, 0);
if( typeLibPathLen > 0 )
LPOLESTR typeLibPath = (LPOLESTR)CoTaskMemAlloc(typeLibPathLen*sizeof(wchar_t));
MultiByteToWideChar(CP_ACP, 0, DllPath, DllPathLen, typeLibPath, typeLibPathLen);
if( FAILED(LoadTypeLibEx(typeLibPath, REGKIND_REGISTER, &typeLib)) )
+#ifndef BUILD_LOCALSERVER
return SELFREG_E_TYPELIB;
typeLib->Release();
+#endif
CoTaskMemFree((void *)typeLibPath);
}
#else