Currently I'm developing a CSharp Project which use madCHook.dll to do the Ipc Stuff (CreateIpcQueue, SendIpcMessage ...) to a C++ service which do the hook work to all process. This combination worked correctly but after each 2 minutes running, my c# program was always terminated by an Exception as below:
"System.NullReferenceException occurred in Unknown module
Additional Information: Object reference not set to an instance of an object"
The program was break at a thread with TID = 6316 and when I looked at processxp (sysinternals), it was a madchook.dll thread (madCHook.dll+0x1bb2c in Windows XP SP3 32bit).
Do anyone have any ideas?
System.NullReferenceException occurred in Unknown module
Re: System.NullReferenceException occurred in Unknown module
madCodeHook 3.x does not have a madCHook.dll, anymore. And it's no longer recommended to use that dll with madCodeHook 2.x, either. What you should do instead is write your own dll with MSVC++ by using the madCodeHook static lib. Your dll would then do all the madCodeHook related stuff inside and export just one or two functions for your C# project.