Sign in to follow this  
nini

Global variables for DLL and client app in c++

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this