View Single Post

  #2 (permalink)  
Old 01-18-2005
Winwaed's Avatar
Winwaed Winwaed is offline
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 892
Blog Entries: 9
I usually use MapPoint in C++ without MFC.

I assume csName is an MFC CString?

The problem might be because the COM interface is expecting its own flavour of string (eg. a BSTR), rather than a 'smart CString object'.

I've just looked at my code (non-MFC, and using STL), and I pass an STL string to a MapPoint method by converting it to a (const char*). When receiving data (ie. querying a field) I have to go via VARIANTs.

Note that your hard-coded string constants are also of type (const char*).


Richard
__________________
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009
Reply With Quote