c++ - Access global variable in runtime-linked dll -


I need to use the Global variable of some legacy DLL in run time. I have a header file for global variable definition Is

  struct CmpSys {public: static const int NAME_LEN = 21; Four SJNM [NAME_LEN]; // user-defined system name}  

global variable is a c ++ Dll is packed in

  CmpSys ** gapCmpSys  

In my CPP file I

  hDEWModelDll = LoadLibrary ( L "DEWModel.dll"); (CMPSIS **) PTRCMPSIs = (CMPSIS **) GETPROCODERES (HDWodeldale, "GpsCMPCS");  

The debugger shows that there is a valid address of ptrCmpSys (not a null), but the content is absolutely wrong.

If I write

  ptrCmpSys [0] -> SzNam  

I'll get a weird chat string.

What should I do?


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -