Archived

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

zackriggle

Exporting variables or #define consts with dlls

Recommended Posts

How (if there is a way) can I export a const variable (or a #defined const) with a DLL??? If you want a little more depth I am using this in my game to make it customizeable, this is particularly for the equipping of items. The mod-maker would specify the proficiency required to use a specific item as a const int value, and the current DLL would be updated with the new information. This is used to limit the use of items according to proficiencies (like DnD 3E). Why don''''t we just kill the guys who write error messages. It''''d make our lives a hell of a lot easier **************************** Gimme a break, I''''m Just 13 (14 in JULY)

Share this post


Link to post
Share on other sites
A #define can''t be exported by a dll because it only has meaning in the context of the preprocessor. However, you can place it into the header file associated with the dll so that it''s available to other coders to use in their projects, much in the same way that defines are used in relation to system libraries and the like.

You might be able to export a constant variable by adding __declspec(dllexport) to the declaration.

As for your specific problem, I don''t know.

Share this post


Link to post
Share on other sites
It sounds like you just want dynamic data into your program... Well, ordinary files can do that... like items.ini or somehting...

quote:

Why don''''t we just kill the guys who write error messages. It''''d make our lives a hell of a lot easier


If I just got like: "10 Errors" and no error messages, that would _NOT_ make my life easier!!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Try using an enum instead of a #define. More often than not you''ll find that they are better suited than #defines

Cheers
Chris

Share this post


Link to post
Share on other sites
hey gee, how ''bout if I change it to *warning* messages, since there are so many annoying ones that don''t really matter at all.

Why don''''t we just kill the guys who write error messages. It''''d make our lives a hell of a lot easier
****************************
Gimme a break, I''''m Just 13 (14 in JULY)

Share this post


Link to post
Share on other sites
quote:
Original post by zackriggle
hey gee, how ''bout if I change it to *warning* messages, since there are so many annoying ones that don''t really matter at all.


Warning messages matter - in fact, you should tell your compiler to treat warnings as errors.




"The word and works of God is quite clear, that women were made either to be wives or prostitutes."
Martin Luther

Share this post


Link to post
Share on other sites