Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Weird Crashing due to Keyboard Input

Author
Message
The Scorpion
21
Years of Service
User Offline
Joined: 12th Oct 2002
Location: United States
Posted: 20th Aug 2006 01:27
Alright, this is the oddest thing, and I can't understand why this happens.

This code works:


But if you uncomment lines [20-23] the program causes a memory access violation. Everything is in scope, all types match. WTF!?

Much regards,
The Scorpion
--Site Temporarily Out of Service--
Charles
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: Phoenix, AZ USA
Posted: 20th Aug 2006 12:21
Several things are wrong, here:

1. When you commented out the braces, you need to also comment out the "if()" statement.

2. When setting the current bitmap to 1, you need to CREATE IT FIRST! Shame on you!

3. It is also a very good idea to make friends with "__try" and "__except()". This way, your functions can exit gracefully instead of your game crashing in the middle of a mission.

I hope this helps.

Charles
The Scorpion
21
Years of Service
User Offline
Joined: 12th Oct 2002
Location: United States
Posted: 20th Aug 2006 17:53
I left the if() statement uncommented because I wanted to prove that that wasn't the issue (since it worked with the following line). But oddly enough, creating the bitmap first worked (i feel weird for not remembering to do that). I just don't see the logic in the error haha. Must be some memory thing I don't know about.

Thanks mate, helped perfectly.

Much regards,
The Scorpion
--Site Temporarily Out of Service--
Charles
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: Phoenix, AZ USA
Posted: 20th Aug 2006 23:23
Glad to be of help.

Login to post a reply

Server time is: 2024-06-26 11:00:11
Your offset time is: 2024-06-26 11:00:11