Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

cyrfer

@cyrfer
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Dll and global variables.
    C cyrfer

    Thus, how I create the g_iYourVariable initialise in one of source files of the first dll, use it in all other sources of the same dll, export it and be able to imported (assuming using __declspec(dllimport)) in any other dll file)? 1 - define a handy macro to make it easy for your DLL to use dllexport and allow clients to use dllimport. Put it in a file, call it "MyDLLExports.h". #ifdef BUILDING_MYDLL # define MyDLLExport __declspec(dllexport) #else # define MyDLLExport __declspec(dllimport) #endif 2 - compile all sources of your DLL with the preprocessor definition 'BUILDING_MYDLL' added - when building only your DLL. 3 - define a header file where your variable will exist. e.g. #ifndef __MyDLL_MyVar_h__ #define __MyDLL_MyVar_h__ #include "MyDLLExports.h" MyDLLExport int MyDLLmyVar; #endif // __MyDLL_MyVar_h__

    C / C++ / MFC question c++ json
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups