[FWTools] VB entry point for OGROpen...

Frank Warmerdam warmerdam at pobox.com
Mon Jul 14 16:13:18 EDT 2008


Gerry James wrote:
> I am trying to develop an application using ASP.NET that will upload a 
> MapInfo TAB file, retrieve the spatial extents, and commit this info to 
> a Postgres database.  I am somewhat new to using the Win32 dll so you 
> will have to excuse my ignorance.  I am trying to declare a number of 
> OGR functions that will let me accomplish this but cannot find the entry 
> point name (Alias) for the functions I need.  The functions I need are 
> OGROpen, OGRGetLayer and OGRGetExtents.  Does anyone know what the 
> Alias’ would  be for these or where I can find some documentation for 
> this.  I have looked at the VB6 class modules that come with 2.1 but I 
> am still stumped.  Any assistance would be greatly appreciated.

Gerry,

My understanding is that functions called from VB6 need to be declared
with "stdcall" calling conventions.  The OGR functions are not declared
this way when GDAL/OGR is built, so I think you will not be able to
call these functions in a normal build of the DLL (such as for FWTools).

If you were to alter the declarations of these functions in
gdal/ogr/ogr_api.h to use the CPL_STDCALL macro (as well as CPL_DLL)
and then rebuilt GDAL/OGR it should be possible to call the functions.

I find it helpful to use depends.exe to find the actual names of
functions in a DLL for the purpose of building VB6 public function
declarations.

Does ASP.NET not support VB.NET?  If you use VB.NET instead of VB6
you should be able to directly use the .net classes written in C#
(as I understand it).  I've never tried doing this myself though.

Questions about C# / .net classes might be better raised on the
gdal-dev list where Tamas is listening.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the FWTools mailing list