From c9cc0f572165e9c92be8c8a571c5c75f06f548a7 Mon Sep 17 00:00:00 2001
From: Geoffroy Couprie <geo.couprie@gmail.com>
Date: Wed, 29 Oct 2008 18:39:56 +0100
Subject: [PATCH] Fix #2062 for activex plugin

---
 projects/activex/plugin.cpp |    2 ++
 projects/activex/plugin.h   |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/projects/activex/plugin.cpp b/projects/activex/plugin.cpp
index 72d9848..aa8c9c9 100644
--- a/projects/activex/plugin.cpp
+++ b/projects/activex/plugin.cpp
@@ -40,6 +40,7 @@
 
 #include "utils.h"
 
+
 #include <string.h>
 #include <winreg.h>
 #include <winuser.h>
@@ -452,6 +453,7 @@ HRESULT VLCPlugin::getVLC(libvlc_instance_t** pp_libvlc)
             {
                 if( i_type == REG_SZ )
                 {
+                    SetDllDirectory(w_pluginpath);
                     if( WideCharToMultiByte(CP_UTF8, 0, w_pluginpath, -1, p_pluginpath,
                              sizeof(p_pluginpath)-sizeof("\\plugins")+1, NULL, NULL) )
                     {
diff --git a/projects/activex/plugin.h b/projects/activex/plugin.h
index 62c4b18..000e555 100644
--- a/projects/activex/plugin.h
+++ b/projects/activex/plugin.h
@@ -23,6 +23,9 @@
 #ifndef __PLUGIN_H__
 #define __PLUGIN_H__
 
+#define _WIN32_WINNT 0x0502
+#include <windows.h>
+#include <winbase.h>
 #include <ole2.h>
 #include <olectl.h>
 
-- 
1.6.0.2

