I don't know of the C++'s but did he take care in storing the info in the data blob correctly? You can just shove some json'd data in there as a string but the docs do state how this could be problematic especially storing the info on windows and reading it on linux... maybe something similar? Just throwing out an idea.
-------------------------------------------- Eric Thivierge http://www.ethivierge.com On Mon, Feb 3, 2014 at 8:47 PM, Jeremie Passerin <[email protected]>wrote: > Hi List, > > > My coworker Tyler is writing his first Cpp solver and we are having a hard > time reading value from a userdatablob. > > The data blob is created and filled by a Python script. The data is a > dictionary stored as a Json string. The value is static. > > From the C++ solver we connect this datablob to an inputport to read it's > value. > > As a test we just tried to log the string value of the datablob, but it > either crashes or doesn't log what we were expecting. In the following > example it crashes. > > Any idea what we are doing wrong ? > > thanks, > > Jeremie > > CStatus simplexCPP_Update( CRef& in_ctxt ){ > > OperatorContext ctxt(in_ctxt); > Application app; > Operator op(ctxt.GetSource()); > CValue blob = ctxt.GetInputValue(0,2,0); > app.LogMessage(blob.GetAsText()); > > const unsigned char *x = NULL; > UserDataBlob b = UserDataBlob(blob); > unsigned int size = 0; > b.GetValue(x,size); > > CString * cstr = (CString*) x; > app.LogMessage(*cstr); > return CStatus::OK; > } > > >

