Community of MapPoint and Bing Maps Users and Developers
This is a discussion on Passing a VARIANT for LinkData() method using VC++ within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi I want to link data over the LinkData() method using a variant as a pointer to my data as ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Passing a VARIANT for LinkData() method using VC++ I want to link data over the LinkData() method using a variant as a pointer to my data as described on the Microsoft website. I have stored data in an Excel file and whish to have it mapped. First column contains the region names, second column contains my personal data to be mapped. The following code will not do: VARIANT PrimaryKeyField; VariantInit(&PrimaryKeyField); PrimaryKeyField.vt=VT_I4; PrimaryKeyField.lVal=0; // The first column is the Key Field (the names of the regions) VARIANT arr; arr.vt=VT_ARRAY | VT_VARIANT; SAFEARRAYBOUND bound = {2,0}: arr.parray=SafeArrayCreate(VT_I4,1,&bound); long x=0; long val=1; // The value for GeoFieldName is 1 (first column) SafeArrayPutElement(arr.parray,&x,&val); x++; val=23; // The value for GeoFieldData is 23 (second column) SafeArrayPutElement(arr.parray,&x,&val); CDataSet DataSet = m_map.GetDataSets().LinkData(filename.xls,PrimaryK eyField,arr,244,0,0): The country code for USA is 244, Delimiter and ImportFlags are both 0 (default). What is going wrong? Thanks in advance Geouser PrimaryKeyField.lVal=0; // The first column is the Key Field |
| |||
| Re: Passing a VARIANT for LinkData() method using VC++
Hi, Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz www.comfortsoftware.be MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| linkdata, method, passing, variant |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C++ and passing Variant Arrays | Anonymous | MapPoint Desktop Discussion | 8 | 12-20-2007 08:06 AM |
| Linking LinkData | DrewD | MapPoint Desktop Discussion | 0 | 02-10-2004 11:22 AM |
| How can i find address by passing Lat/Lon as parameter? | joesebi | MapPoint Desktop Discussion | 1 | 07-09-2003 10:10 AM |
| LinkData and VC++ | sowtschi | MapPoint Desktop Discussion | 0 | 07-07-2003 10:32 AM |
| Is it possible to use the Linkdata() method to con.... | Anonymous | MapPoint Desktop Discussion | 1 | 04-26-2002 09:06 AM |