Click to See Complete Forum and Search --> : Debugging Problems


Drezard
February 21st, 2007, 01:18 AM
Hello, Im trying to now make my engine into a DLL. I've run into a few problems...

Now [A] Do I call the constructors and destructors as static __declspec(dllexport)?

[B] What does the Static bit mean? Like I also have this code:


static LRESULT CALLBACK AppWindowProc(HWND hWnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam);
static SystemCore* g_pApp = 0;


My friend helped me with this bit and I still don't understand what it means...

Cheers, Daniel

UnfitElf
February 21st, 2007, 01:30 AM
Im not sure if its the same meaning in this situation, but i would guess it means that no matter how many instances of the dll are loaded they all call the same callback. i.e. i would guess it has a similar meaning as a static function in a class.

e.g.


// Computer memory position 1
// NON-static callback Dll is loaded

Programe 1 loads dll and its callback is
|
|
|--> here is memory

// Computer memory position 2

// NON-static callback Dll is loaded via again by some other programe
Programe 2 loads dll and its callback is
|
|--> here in memory (i.e. a differnt position than from programe 1)


however if its static its like this


// Computer memory

Programe 1 callback is Programe 2 callback is
| |
| |
|--> here <----------------|

i.e. callback is here for all instances of the loaded Dll


I may have this wrong as im only guessing (yikes!) however, im sure someone wil happily correct me if im wrong.

Sorry the explnation is so bad.