Archived

This topic is now archived and is closed to further replies.

glPerfect

Export Functions

Recommended Posts

A J Oja    122
Okay, since this probably handles with DLL exporting, here''s a sample:

We have a class CPlayer which has member function Spawn(). We can either export the whole class:

class __declspec(dllexport) CPlayer
{
// .. blah .. //
};

or then just export the function:

__declspec(dllexport) void Spawn(vector3_t dir, vector3_t pos);

Either way, you have to consider which way to use very carefully. I do alot of OOP and I usually export the whole damn class. Usually, not always.

It might also be easier if you use a macro like this:
#ifdef YOURDLL_EXPORTS
#define YOURDLL_API __declspec(dllexport)
#else
#define YOURDLL_API __declspec(dllimport)
#endif
dump that into a header file and vóila! Then you can use the *****_API macro instead of the bloody __declspec() crap. Make sure you define the ***DLL_EXPORTS in your DLL.

- A.J. -
"Where is the KABOOM?! There was supposed to be an earth-shattering KABOOM!"

Share this post


Link to post
Share on other sites