I'm having a lot of issues passing std::strings into ActiveMQ-CPP interfaces,
i.e. Connection, Session, Message and etc.
Even though I'm using MS VS2010 to build both activemq-cpp dll and my
application with the same version of multithreaded c-runtime dll
MSVCP100.dll, MSVCR100.dll(/MD) , string object passed from the app to
activevemq-cpp dll looks corrupted in debugger when I step into activemq-cpp
code...
I'm wondering if anyone else experienced this issue...
In general, I'm kind of surprised that std::strings where chosen for public
JMS public interfaces as it creates binary compatibility issue between the
app and dll. std::string is a class that does dynamic memory management. You
cannot pass std::string between DLL and app unless

1) The DLL and application must be built with the same compiler, version,
compiler settings, and exact same version of STL. You cannot mix and match
compilers and settings between app and DLL. 

2) The DLL and application must be using the DLL version of the runtime
library. Otherwise the two std::strings would be using two different heap
managers, causing a problem.

All the above make it difficult to maintain your app... Everytime, you move
to build an app with newer compiler you need to rebuild activemq-cpp as
well?

Wouldn't it be better to stick to primitive const char* instead?  



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Problem-using-ActiveMQ-CPP-interfaces-where-std-string-are-used-as-parameters-tp4196115p4196115.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to