Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A5F859CB8 for ; Wed, 14 Dec 2011 17:42:24 +0000 (UTC) Received: (qmail 41959 invoked by uid 500); 14 Dec 2011 17:42:24 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 41924 invoked by uid 500); 14 Dec 2011 17:42:24 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 41916 invoked by uid 99); 14 Dec 2011 17:42:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Dec 2011 17:42:24 +0000 X-ASF-Spam-Status: No, hits=3.0 required=5.0 tests=FORGED_YAHOO_RCVD,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Dec 2011 17:42:15 +0000 Received: from joe.nabble.com ([192.168.236.139]) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1Rasq2-0006YR-L0 for users@activemq.apache.org; Wed, 14 Dec 2011 09:41:54 -0800 Date: Wed, 14 Dec 2011 09:41:54 -0800 (PST) From: mikmela To: users@activemq.apache.org Message-ID: <1323884514643-4196115.post@n4.nabble.com> Subject: Problem using ActiveMQ-CPP interfaces where std::string are used as parameters MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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.