Community of VE/MapPoint Users and Developers
This is a discussion on calling ImportData from C++ within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I'm looking for a way to Import Data using the "ImpotData" method with C++. Here is my code, which unfortunately ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Here is my code, which unfortunately doesn't work: Please help me!! VARIANT arr; arr.vt = VT_ARRAY | VT_VARIANT; SAFEARRAYBOUND bound = {6,0}; arr.parray = SafeArrayCreate(VT_I4,1,&bound); ASSERT(arr.parray); long x=0; long val =geoFieldName; // (first column) SafeArrayPutElement(arr.parray,&x,&val); x++; val = geoFieldName2; // (second column) SafeArrayPutElement(arr.parray,&x,&val); x++; val = geoFieldCountry; // (3 column) SafeArrayPutElement(arr.parray,&x,&val); x++; val = geoFieldCity; // (4 column) SafeArrayPutElement(arr.parray,&x,&val); x++; val = geoFieldAddress1; // (5 column) SafeArrayPutElement(arr.parray,&x,&val); x++; val = geoFieldPostal1; // (6 column) SafeArrayPutElement(arr.parray,&x,&val); COLEMapPointDataSets oMPDataSets = oMPMap.DataSets(); ASSERT(oMPDataSets.Ok()); const long geoImportFirstRowNotHeadings = 1; const long geoImportFirstRowIsHeadings = 0; COLEMapPointDataSet oMPDataSet = oMPDataSets.ImportData("c:\\temp\\export.txt", arr, geoCountryMultiCountry, geoDelimiterTab, geoImportFirstRowIsHeadings); |
| |||
| Re: calling ImportData from C++
Hi Tim, No the '\' is in some languages an escape character to use in strings for special purposes. So since it is an escape character it has to be escaped by itself. hence \\
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: calling ImportData from C++
Pit, Can you also tell what does not work ? Or is there an error or exception ? What is the offending line of code ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| calling, importdata |
| ||||
| Posted By | For | Type | Date | |
| Determing Whether A Point Is Located Inside Polygon - MapPoint Articles - MP2K Magazine | This thread | Refback | 12-21-2007 09:26 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calling all Micro-ISVs! | Winwaed | General Chat | 2 | 05-05-2006 12:16 PM |
| Calling MapPoint From C++ Without the MFC Safety Net | Eric Frost | MP2K Magazine Articles | 3 | 06-09-2004 08:40 AM |
| Calling Mappoint 2004 from ASP/COM | Anonymous | MapPoint 2006/2009 Discussion | 4 | 02-12-2004 07:19 PM |
| 911 outbound calling | LLurie | MapPoint 2006/2009 Discussion | 4 | 04-21-2003 10:41 AM |
| VBA calling MP2k2 | rkehn | MapPoint 2006/2009 Discussion | 2 | 01-15-2003 12:47 PM |