Jump to content
  • Advertisement
Sign in to follow this  
nini

Global variables for DLL and client app in c++

This topic is 4621 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

Hi all , i was wondering how can i declare a global variable so that it is accessible both by DLL clients and the DLL itself ? How to do it ? (put the var in stdafx.h with extern keyword don't seem to work because i get link error when building the client app) What i want to do is to access the LPDIRECT3DDEVICE9 variable or a Renderer Class just everywhere in my code , is this feasible ? tbanx in advance for your help...

Share this post


Link to post
Share on other sites
Advertisement
You can make a global variable accessible by clients of the DLL by declaring it __declspec(dllexport) like a class or function.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
You can make a global variable accessible by clients of the DLL by declaring it __declspec(dllexport) like a class or function.


yep i already know this but what i want is to both export for clients and use it internally in the DLL , is it possible ?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!