Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Error 126 while running wpf project

$
0
0

Hi,
 I am doing wpf project in which i have do multiple activities at same time so i use background worker process for each activity. i use class library. and also uses code

public static class ActivityManager
    {
        public static event KeyEventHandler KeyDown;
        public static event KeyPressEventHandler KeyPress;
        public static event KeyEventHandler KeyUp;
        public static event MouseEventHandler MouseClick;
        public static event EventHandler<MouseEventExtArgs> MouseClickExt;
        public static event MouseEventHandler MouseDoubleClick;
        public static event MouseEventHandler MouseDown;
        public static event MouseEventHandler MouseMove;
        public static event EventHandler<MouseEventExtArgs> MouseMoveExt;
        public static event MouseEventHandler MouseUp;
        public static event MouseEventHandler MouseWheel;
}

which gives me Error code 126:The specified module could not be found.
 ActivityManager is a class as follows:

public static class ActivityManager
    {
        public static event KeyEventHandler KeyDown;
        public static event KeyPressEventHandler KeyPress;
        public static event KeyEventHandler KeyUp;
        public static event MouseEventHandler MouseClick;
        public static event EventHandler<MouseEventExtArgs> MouseClickExt;
        public static event MouseEventHandler MouseDoubleClick;
        public static event MouseEventHandler MouseDown;
        public static event MouseEventHandler MouseMove;
        public static event EventHandler<MouseEventExtArgs> MouseMoveExt;
        public static event MouseEventHandler MouseUp;
        public static event MouseEventHandler MouseWheel;
}


Although, i have added all the references and intellisense working i still get "Error :126" i.e The specified module could not be found.

HookManager_MouseMove is a event which i specify at runetime for handling  MouseMove event.

I am using HookManager to monitor activities of Keyboard and mouse in Async Mode as register event handler in background worker process but , i am getting error 126 i.e Specified module is not Found.Does it work in Async Mode?

I am using class library specified in at:
 
http://www.codeproject.com/Articles/7294/Processing-Global-Mouse-and-Keyboard-Hooks-in-C
 
and 
code 
if (s_KeyboardHookHandle == 0)
{
//See comment of this field. To avoid GC to clean it up.
s_KeyboardDelegate = KeyboardHookProc;
//install hook
s_KeyboardHookHandle = SetWindowsHookEx(
WH_KEYBOARD_LL,
s_KeyboardDelegate,
Marshal.GetHINSTANCE(
Assembly.GetExecutingAssembly().GetModules()[0]),
0);
 
gives me error 126

Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>