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 / access violations with dbScreenHeight(), and other db functions.

Author
Message
shiny
20
Years of Service
User Offline
Joined: 17th Jan 2004
Location: Santa Monica
Posted: 6th Jul 2005 19:21 Edited at: 6th Jul 2005 19:29
EDIT: It seems that this problem only arises when the class is declared globaly instead of localy elsewhere. I wonder why this is!

Here is an odd something!.

With one of my classes I get a runtime error in which the debugger points to "dbScreenWidth()" as the culprit. It seems allot of other db functions produce similar errors in that same class (for instance, "dbLoadObject"). Other db functions like "dbPositionCamera()" work fine in the class . The functions I am talking about are in the class initialization.

How might I have set the class up incorrectly to have it produce these results? I also get problems with some non darkSDK functions in this class.

"
Unhandled exception at 0x0040f0f5 in hans_treasure_hunter.exe: 0xC0000005: Access violation reading location 0x000002b8.
"

Any help would be appretiated. Its driving me nuts that I can't work out what the problem is!!!

OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 6th Jul 2005 20:05
Any chance of seeing the offending class ?

shiny
20
Years of Service
User Offline
Joined: 17th Jan 2004
Location: Santa Monica
Posted: 6th Jul 2005 20:46
Noop, not available : (.

For now I have fixed the error by creating an instance of the class in a place other than globaly. Strange that creating this class globaly would create access errors. Might this be because it falls outside the scope of DarkSDK(){ }?

*is sleepy and confused but glad its working to an extent.

OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 6th Jul 2005 20:51 Edited at: 6th Jul 2005 20:52
Its certainly odd, unless the calls were being multi-threaded (so one db function was called my your class whilst its in the db function).

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Jul 2005 21:52
I'm assuming that you are creating a module-level object that accesses DarkSDK run-time functions. In that case, your object is probably accessing them before the SDK has been initialised.

If they must be held at that scope, then use a pointer and create the object in the DarkSDK function instead.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
shiny
20
Years of Service
User Offline
Joined: 17th Jan 2004
Location: Santa Monica
Posted: 8th Jul 2005 02:14
Ah, your right! So I was accessing dark SDK before it was initiated!

Thanks for the help, You managed to shed some light on a rather annoying error I have been getting for quite some time.

: ).

Login to post a reply

Server time is: 2024-04-20 05:23:55
Your offset time is: 2024-04-20 05:23:55