Re: share data between dll's




"tasleem" <tasleem@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9FC714D6-6BB8-4E54-BBC0-D1FAE04AE8FB@xxxxxxxxxxxxxxxx
hi -->thanks for reply
2dll project name is awWebBubbleSDK so i m using this in class header file
"DragHelper.h"
#if awWebBubbleSDK
#define SHARED_STUFF __declspec(dllexport) extern "C" bool
m_bStartWatchThread=false;
#define SHARED_STUFF __declspec(dllexport) extern "C" int intvar=23;
#else
#define SHARED_STUFF __declspec(dllimport) extern "C" bool
m_bStartWatchThread=false;
#define SHARED_STUFF __declspec(dllimport) extern "C" int intvar=23;
#endif

Like this:

#if awWebBubbleSDK
#define SHARED_STUFF __declspec(dllexport) extern "C"
#else
#define SHARED_STUFF __declspec(dllimport) extern "C"
#endif

SHARED_STUFF bool g_bStartWatchThread;
SHARED_STUFF int g_intvar;

Then put your initializations only in one source file (not header file) in
the dll doing the export:

bool g_bStartWatchThread = false;
int g_intvar=23;


.



Relevant Pages


Loading