Jump to content

KeyBoard hook in c#

RonCohen

hello its my first time in the forum and sorry for my english.

 

 

so here is the problem:

i build a c# program using keyboard hook because i practice the hook in differnt ways i create .cs file that have the hook.

when i run the program from my computer its working perfectly but when i publish it and run it on VM or my other PC(Windows 7) the program crash.

anyone know what should i do?

i5 2500K @ 4.4GHz Gigabyte GA-Z68X-UD7-B3  Gigabyte GTX670 OC 8Gb 1600 Corsair Vengeance LP


    Samsung 128Gb 840 PRO WD Black Caviar 1TB Seagate Baracuda 7200.14 1TB  Samsung SpinPoint F3 1TB


Fractal Design Define R4 Titanium  Enermax Modu82+ 625W

Link to comment
Share on other sites

Link to post
Share on other sites

Oh I have had this happen before...there can be a few causes behind the crash.

 

When the program crashes does it give a crash dialogue (something similar to this http://telcontar.net/store/archive/CrashGallery/images/crash/m/scandisk.png )

If so click on the details and post what the dialogue says....or you could try deciphering the problem yourself if you feel up to it (it typically gives which class it crashes in)

 

It could also help posting the source, as then we could help you by pointing to the exact problem.

 

The final bit of advice is when running the debug version in VS, click the pause button after the program would have crashed...on the right (or at least on my setup), there is the error messages and see if you see any...debug mode sometimes likes hiding them

 

The time I had this happen, it was using an uninitialized.  The problem is if you run C# programs through VS, VS sometimes suppresses certain errors...or in the worst case VS can cause variables to be initialized when they won't be in practice (I am assuming it was debugging that caused it).

 

So sorry this is as much help I can be, but if you get a crash dialogue it can be very helpful.

0b10111010 10101101 11110000 00001101

Link to comment
Share on other sites

Link to post
Share on other sites

I didn't get a crash dialog it show me an error windows that says:

"A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available"

and then i have Close Program or Debug

 

and in VS i run it and then stop when it should crash and the VS dont show any error or warning.

 

 

Im no near to my Main Computer when i get home i will post the source.

 

 

i have another PC with VS installed and when i run it through the VS its run ok.

i5 2500K @ 4.4GHz Gigabyte GA-Z68X-UD7-B3  Gigabyte GTX670 OC 8Gb 1600 Corsair Vengeance LP


    Samsung 128Gb 840 PRO WD Black Caviar 1TB Seagate Baracuda 7200.14 1TB  Samsung SpinPoint F3 1TB


Fractal Design Define R4 Titanium  Enermax Modu82+ 625W

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×