View Full Version : Spatial Data Import COM Add-in

01-02-2003, 03:17 PM
I'm trying to access the Spatial Data Import COM Add-in from within my own vb application. I cannot seem to communicate with the COM addin.

Here is the below code i have tried:

Private Declare Sub MyDisplay Lib "C:\Program Files\Microsoft Visual Studio\Common\MSDev98\AddIns\SpatialDataImportCode \SpatialDataImport.dll" Alias "Display" (omMap As Map, oConnect As Connect)

Call MyDisplay

The above code gives an error saying it cannot find the entry ("Display") point for the dll.

I have also tried:

Set oAddIns = oApp.AddIns

Set oMyAddIn = oAddIns.Connect("SpatialDataImport.Connect")

But, it also dies saying that the object does not support the "Display" Method.

From what I can tell, the Display method is the only public function in the spatial data import code.

I CAN get the add in to work, if I do this manually through the actuall Microsoft Mappoint application. Tools -> Com Add-ins... and i can then load my esri file, but I cannot automate the process in my own VB application with the mappoint control.

Anyone have any ideas - my last idea would be to just do it manually, but then I cannot get the "File, Edit, View..." Toolbar to display - only the toolbars below it.

Any Ideas?



Eric Frost
01-02-2003, 03:52 PM
I've included components of the Spatial Data Import Add-in in other projects.. you essentially have to delve into the code and find the parts that do the work of parsing the mif/mid or shape file and insert that into your VB app. If you only have a single type of object (polygons for instance) the required lines of code can be very straightforward.