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 / Unfamiliar errors

Author
Message
Nithead
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Hampshire, England
Posted: 9th Mar 2009 21:39
Hey guys this is my first post,

I have been writing a program which i want to simulate an eco-system. so far i have created an array for the spheres, but when i added the code to try and make them bounce it did some weird things:

First i came up with a box saying: Unhandled exception at 0x004c731e in Equilibrium.exe: 0xC0000005: Access violation reading location 0x00136b10.

It gave the options of 'Break' and 'Continue'

If i press Continue nothing happens, but if i press Break I noticed that the box with all the information about compiling said:

First-chance exception at 0x004c731e in Equilibrium.exe: 0xC0000005: Access violation reading location 0x00136b10.
Unhandled exception at 0x004c731e in Equilibrium.exe: 0xC0000005: Access violation reading location 0x00136b10.

A yellow arrow appears next to my code.

I have no idea why this would be happening as it hasnt done so before.

here is my code:


True geeks live forever, or die trying.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 10th Mar 2009 09:38 Edited at: 10th Mar 2009 21:52
Sm is not initialized so you are trying to move an object that is not created and thus writing to unallocated memory and causing an access violation. I set Sm to = 0 at the start and the problem was solved.

[edit] Did not read code properly, Sm is not used with dbMoveObject so this is not the cause of the access violations.
Nithead
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Hampshire, England
Posted: 10th Mar 2009 18:28
I have tried this but it still shows the same errors

True geeks live forever, or die trying.
Nithead
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Hampshire, England
Posted: 10th Mar 2009 21:14
Please help i hate it when these things happen T.T

True geeks live forever, or die trying.
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 10th Mar 2009 21:51 Edited at: 10th Mar 2009 21:55
[edit]
Using the debugger I can see that with dbMoveObject, Sid is always 0; object IDs range from 1 upwards so you are trying to move an object that doesn't exist. The dbMoveObject I am referring to is after the "// Run the spheres" comment.
Nithead
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Hampshire, England
Posted: 10th Mar 2009 23:27
I AM SUCH AN IDIOT

thank you its all so obvious what was wrong now!!!

the collision isnt working but ill work on that now

True geeks live forever, or die trying.
Nithead
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Hampshire, England
Posted: 11th Mar 2009 00:50
i've gotten another problem. The collision and bouncing off of the spheres on the blockers on the left and right (obj numbers 203 and 202) works perfectly, but nothing i can do will make the other two work.

please help

True geeks live forever, or die trying.
Nithead
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Hampshire, England
Posted: 11th Mar 2009 00:52
here is the code:


True geeks live forever, or die trying.

Login to post a reply

Server time is: 2024-11-25 17:35:29
Your offset time is: 2024-11-25 17:35:29