MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




calling ImportData from C++

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 12-20-2007
Junior Member
White Belt
 
Join Date: Dec 2007
Location: Germany
Posts: 9
Post calling ImportData from C++

I'm looking for a way to Import Data using the "ImpotData" method with C++.

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);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 01-02-2008
Member
Yellow Belt
 
Join Date: Feb 2005
Posts: 48
Re: calling ImportData from C++

I hate to say it, looks like a typo to me.

But it might be your import file reference at end of your code:

c:\\temp\\export.txt

extra \ ?

Tim Miltz
Last Seen typing this line.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 01-03-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
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 \\
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 01-03-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
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 ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
calling, importdata


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/calling-importdata-c-6922.html

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 10:12 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54