How to Call a static member variable from another DLL
-
hi all, i am having Two DLL's and in one Dll i am having a Class, in that Class i am having a static member variable. Now in another DLL's Class i want to acess the One's (First Dll's) static member variable. //---------------------------------------------------------- First DLL, Class One { static int onevar; } //---------------------------------------------------------- my question is in the second Dll Class Two { // I want to dynamically link only the First Member Variable. } Please give any code such that i can access the First DLL static Member Variable in the Second DLL. Any Import Techinique.
Uday kiran
-
hi all, i am having Two DLL's and in one Dll i am having a Class, in that Class i am having a static member variable. Now in another DLL's Class i want to acess the One's (First Dll's) static member variable. //---------------------------------------------------------- First DLL, Class One { static int onevar; } //---------------------------------------------------------- my question is in the second Dll Class Two { // I want to dynamically link only the First Member Variable. } Please give any code such that i can access the First DLL static Member Variable in the Second DLL. Any Import Techinique.
Uday kiran
example #define TESTDLL_API __declspec(dllexport) //Testdll.h
class TESTDLL_API CTestDLL { public: CTestDLL(void); static int m_i; // TODO: add your methods here. };
//Testdll.cppTESTDLL_API int CTestDLL::m_i=0;
In DLL two, where you are going to use this header file and define TESTDLL_API macro as __declspec(dllimport).... Hope this helps.. Thanks... Please let me know if you have some doubt....Suraj Gupta