Index: src/Common/DelftTools.Utils/Interop/OcxHelper.cs =================================================================== diff -u -r8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9 -r5fc71a385897af92ccb092f2f969b5709afab85a --- src/Common/DelftTools.Utils/Interop/OcxHelper.cs (.../OcxHelper.cs) (revision 8f6ae890fed8e8eae3a32f9c0498a10f82e0ddf9) +++ src/Common/DelftTools.Utils/Interop/OcxHelper.cs (.../OcxHelper.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -8,11 +8,6 @@ /// public class OcxHelper { - [DllImport("kernel32.dll")] static extern bool FreeLibrary(IntPtr hModule); - [DllImport("kernel32.dll")] static extern IntPtr LoadLibrary(string lpFilename); - [DllImport("kernel32.dll")] static extern UIntPtr GetProcAddress(IntPtr hModule, string lpProcName); - [DllImport("user32.dll")] static extern IntPtr CallWindowProc(UIntPtr lpPrevWndFunc, IntPtr hWnd, uint Msg, UIntPtr wParam, IntPtr lParam); - /// /// Registers ocx with windows /// @@ -33,6 +28,18 @@ return (Register(ocxPath, false)); } + [DllImport("kernel32.dll")] + private static extern bool FreeLibrary(IntPtr hModule); + + [DllImport("kernel32.dll")] + private static extern IntPtr LoadLibrary(string lpFilename); + + [DllImport("kernel32.dll")] + private static extern UIntPtr GetProcAddress(IntPtr hModule, string lpProcName); + + [DllImport("user32.dll")] + private static extern IntPtr CallWindowProc(UIntPtr lpPrevWndFunc, IntPtr hWnd, uint Msg, UIntPtr wParam, IntPtr lParam); + private static bool Register(string ocxPath, bool register) { IntPtr lb = IntPtr.Zero; @@ -50,7 +57,6 @@ pa = GetProcAddress(lb, "DllUnregisterServer"); } - if (CallWindowProc(pa, IntPtr.Zero, 0, UIntPtr.Zero, IntPtr.Zero) == IntPtr.Zero) { return (true); @@ -69,6 +75,5 @@ FreeLibrary(lb); } } - } -} +} \ No newline at end of file