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 / Use DarkGDK functions in another class

Author
Message
Lazlazlaz 1
19
Years of Service
User Offline
Joined: 18th Sep 2005
Location: England
Posted: 10th May 2010 01:09
I tried searching but couldn't find an answer.

How would I use a DarkGDK function in a class, so not within void DarkGDK (void) { ... }?

For example:



The program crashes unless I remove db commands in the Application constructor.

DarkGDK is good
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 10th May 2010 01:11 Edited at: 10th May 2010 01:11
#include "DarkGDK.h" inside the Application header.

JTK

EDIT: Or in your example above, as the first line...
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 10th May 2010 01:24 Edited at: 10th May 2010 01:24
You can use DarkGDK functions as long as DarkGDK() has been called first.

The call to DarkGDK() sets up necessary internal data for it to run correctly, and you saw what the consequence is for trying to use DarkGDK before it's initialized.

If 'app' needs to be global, just use the default constructor first, and then call another appropriate constructor after DarkGDK() has been called.



"A computer once beat me at chess, but it was no match for me at kick boxing."
Emo Philips
Lazlazlaz 1
19
Years of Service
User Offline
Joined: 18th Sep 2005
Location: England
Posted: 10th May 2010 01:24
ah, so simple. Cheers.

DarkGDK is good

Login to post a reply

Server time is: 2024-11-19 23:46:25
Your offset time is: 2024-11-19 23:46:25