Hi Group:
 
A few pointers:
 
The issues demonstrated in the sample code provided by the user are:
 
1. Options array:
 
''' =====================
''' ORIGINAL
''' =====================
Dim Options(2) As Variant
Options(0) = "Option Name"
Options(1) = "Option Value"
 
''' A GISDK 'options array' is a 2-D, 'SafeArray' constructed using the Array() 
function
''' =====================
''' CORRECTION TO ORIGINAL
''' =====================
Dim Options As Object
Options = Array(Array("Option One", "Option One Value"), Array("Option Two", 
"Option Value"))
 
2. The backslash character ("\") does not have to be 'escaped' in VB6 the way 
it does in a GISDK RSC file.
 
''' =====================
''' Not Necessary
''' =====================
Dim MyFileName As String
MyFileName = "X:\\Directory_A\\Project_X\\File123.txt"
Gisdk.Function("OpenFile", MyFileName, "r")
 
''' =====================
''' Correct
''' =====================
Dim MyFileName As String
MyFileName = "X:\Directory_A\Project_X\File123.txt"
Gisdk.Function("OpenFile", MyFileName, "r")
 
I hope this helps.
 
Stewart
 
Stewart J. Berry (BSc, MSc)
GIS Specialist
Caliper Corporation


 



From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Armando
Sent: Wednesday, October 22, 2008 4:53 PM
To: [email protected]
Subject: [Maptitude] Re: Maptitude COM object in VB6
 
It sounds like a projection error.

You may need to define the projection type in array_options.

Look at your input CSV file: is there any coordinate conversion that
need to be made? (floats, integers, strings)?

Try running ImportCSV with the same parameteres directly from the
Inmediagte Execution dialog box. If it works fine then you may suspect
a problem on youtr array_options

Good luck

Armando

--- In [email protected], "moorantle" <[EMAIL PROTECTED]> wrote:
>
> I am trying to use the Maptitude COM object in Visual Basic 6. I
> followed the example, which runs fine, but can not figure out how to
> successfully call the function I need. All I am trying to do at this
> point is convert a CSV file to a DBD file. 
> 
> Public Sub GeoFileToDBD(geofilename as String)
> 
> Dim gisdk As Object
> Dim newfilename As String
> Dim array_options(2) As Variant
> 
> array_options(0) = "Layer_Name"
> array_options(1) = Left(geofilename, Len(geofilename) - 3)
> geofilename = Replace(geofilename, "\", "\\")
> newfilename = Left(geofilename, Len(geofilename) - 3) & "dbd"
> Set gisdk = CreateObject("Maptitude.AutomationServer")
> Call gisdk.Function("ImportCSV", geofilename, newfilename, "Line",
> array_options)
> 
> End Sub
> 
> I get and error on the last line. Runtime error type '6', Overflow. 
> Can someone please help?
>
 

Reply via email to