Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 4 of 4

calling ImportData from C++

This is a discussion on calling ImportData from C++ within the MapPoint Desktop 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 ...

  1. #1
    Pit Mueller is offline 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);

  2. #2
    tfmiltz is offline Member Green Belt
    Join Date
    Feb 2005
    Posts
    52

    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.

  3. #3
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

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

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    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 ?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Calling all Micro-ISVs!
    By Winwaed in forum General Chat
    Replies: 2
    Last Post: 05-05-2006, 11:16 AM
  2. Calling MapPoint From C++ Without the MFC Safety Net
    By Eric Frost in forum MP2K Magazine Articles
    Replies: 3
    Last Post: 06-09-2004, 07:40 AM
  3. Calling Mappoint 2004 from ASP/COM
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 02-12-2004, 06:19 PM
  4. 911 outbound calling
    By LLurie in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 04-21-2003, 09:41 AM
  5. VBA calling MP2k2
    By rkehn in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-15-2003, 11:47 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93