Jump to content
  • Advertisement


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


Export Functions

This topic is 6059 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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:
#define YOURDLL_API __declspec(dllexport)
#define YOURDLL_API __declspec(dllimport)
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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!