![]() |
| ||
| Windows Console Mouse operations Hi all, i'm looking into doing a little bit of work with the mouse in console applications on windows. I'm using windows.h to get access to functions such as ReadConsoleInput. I've created a simple program that just prints a string whenever the left most mouse button is clicked. However sometimes it works fine sometimes it doesn't. By doesn't work it seems to be that when i run it if my curser is out side the console window then when i move my mouse into the console window it crashes. If it is inside to begin with then i seems to be ok....quite odd. I was wondering if you could shed some light on where i have gone wrong thanks. #include <iostream> Chris |
| ||
| Re: Windows Console Mouse operations > ReadConsoleInput(stin, inputStat, 1, &NumRead); How about ReadConsoleInput(stin, inputStat, numEvents, &NumRead); > delete inputStat; How about delete [ ] inputStat; You should also check the console API calls for success/failure as well. |
| ||
| Re: Windows Console Mouse operations How silly of me, Ye i was just tyrying to get it working before i set up failure checks, thanks for that. It was 2 silly mistakes. It's because i originally had it set up not using an array just to process one event and din't think to update those bits lol Thanks, Chris |
| All times are GMT -4. The time now is 1:43 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC