Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

TheHermit

Direct Input - Debug Assertion Failed

This topic is 6054 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well, i searched the forum but none could provide a topic for my particular problem (none that i found any way) Using DX8.1, VC++5.0 I Have a window(application) class, which is called and initialized by the main program. This means i have successfully setup a message loop incorporating a static member of the class, with setwindowlong trickery. The window class contains a CPlayer object (the player) and a CInput object. (a direct input wrapper) (amongst other bits and bobs) I am using a timer message to retrieve the keyboard data periodically, and in the handler for WM_TIMER call: window->m_input.getKeyboardInput(); which reads the buffered data from the keyboard into the CInput class (m_Input) I then call window->processKeyboard(); which accesses m_Input to determine if a key has been pressed and then handles it. The Problem. ============ (note big double underline) The program essentially does nothing. Which is good. That is until I handle a key press through processKeyboard(). Then it crashes. crashes and burns. "Debug assertion failed Program: ...app.exe //my exe File: dbgheap.c //not mine Line: 1011 Expression: _CrtlsValidHeapPointer(pUserData) For information on how your program can cause an assertion failure see the VC++ docs on asserts" (abort)(retry)(ignore) This is followed by "illegal operation ... prog shut down" I checked several things, and turns out that even if i call a message box in the WM_TIMER part of my window proc switch, the same occurs. BUT, if i take out the window->processKeyboard() call, the timer succeeds again and again. also, if i press a key that is NOT handled by the above, no crash. if i include the key in the switch handling the individual keys, but no function call, no crash. Can post more code on request, but thought i would give a background first as am working on a different pc, and, well copy paste just not an option Thanks for any insight, will answer any q's Edited by - thehermit on February 21, 2002 11:51:11 AM

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!