[postgis-users] Old zigGIS Post - Fwd: zigGIS for ArcObjects 9.x

Abe Gillespie abe.gillespie at gmail.com
Wed Dec 7 13:08:19 PST 2005


I've included an old post for those of you interested in compiling for
9.x.  You won't have to do anymore VBA code since there's now an
included tool (though you may need to change some things for 9.x.
ArcObjects).  Also, the memory access error was probably being caused
by a broken Npgsql assembly ... you shouldn't have this problem
anymore with the supplied patched version.

Let me know if you have any luck or questions.

Thanks.
-Abe

---------- Forwarded message ----------
From: Roy Irwan <mroy at centrin.net.id>
Date: Oct 11, 2005 9:03 AM
Subject: [Ziggis-devel] zigGIS  for ArcObjects 9.x
To: Ziggis-devel at cvs.uwc.ac.za


Hi,
I have successfully compile zigGis using ArcObjects 9.x.
Unfortunately, I still get memory read error. :(
Maybe next time I will inspect the problem.

Here is the full story:

I use Borland C# Builder. Unfortunately I can't import directly from
ziggis csprojs. So, I have to create the projects manually.

Then, I change some references to ArcObjects to reflect 9.x version.
Here are the diffs:

<===================================================================>
Base file: D:\Assemblies\zigGIS.orig\postgis_helpers\helpers.cs
Compared file: D:\Assemblies\zigGIS-01\postgis_helpers\helpers.cs

23c23,25
< using ESRI.ArcObjects.Core;
---
 > using ESRI.ArcGIS.esriSystem;
 > using ESRI.ArcGIS.Geometry;
 > using ESRI.ArcGIS.Geodatabase;

<===================================================================>
Base file: D:\Assemblies\zigGIS.orig\postgis_helpers\layer_helper.cs
Compared file: D:\Assemblies\zigGIS-01\postgis_helpers\layer_helper.cs

23c23,24
< using ESRI.ArcObjects.Core;
---
 > using ESRI.ArcGIS.Geometry;
 > using ESRI.ArcGIS.Display;

<===================================================================>
Base file: D:\Assemblies\zigGIS.orig\postgis_featurecursor\cursors.cs
Compared file: D:\Assemblies\zigGIS-01\postgis_featurecursor\cursors.cs

23c23
< using ESRI.ArcObjects.Core;
---
 > using ESRI.ArcGIS.Geodatabase;

<===================================================================>
Base file: D:\Assemblies\zigGIS.orig\postgis_featurecursor\feature.cs
Compared file: D:\Assemblies\zigGIS-01\postgis_featurecursor\feature.cs

2c2
< using ESRI.ArcObjects.Core;
---
 > using ESRI.ArcGIS.Geodatabase;

<===================================================================>
Base file: D:\Assemblies\zigGIS.orig\postgis_geodatabase\featureclasses.cs
Compared file: D:\Assemblies\zigGIS-01\postgis_geodatabase\featureclasses.cs

23c23,26
< using ESRI.ArcObjects.Core;
---
 > using ESRI.ArcGIS.Geodatabase;
 > using ESRI.ArcGIS.esriSystem;
 > using ESRI.ArcGIS.Geometry;
 > using ESRI.ArcGIS.Display;
896a900
 > //           public IEnumIDs IDs { get { return null; } }

<===================================================================>
Base file: D:\Assemblies\zigGIS.orig\postgis_geodatabase\workspace.cs
Compared file: D:\Assemblies\zigGIS-01\postgis_geodatabase\workspace.cs

23c23,26
< using ESRI.ArcObjects.Core;
---
 > using ESRI.ArcGIS.Geodatabase;
 > using ESRI.ArcGIS.esriSystem;
 > using ESRI.ArcGIS.Geometry;
 > using Nini.Util;
1115a1119,1120
 >                                              if (Reloaded != null)
 >               Reloaded(this, EventArgs.Empty);
1117a1123,1124
 >                              public event EventHandler Reloaded;
 >
1125a1133,1134
 >                                              if (Saved != null)
 >                                                      Saved(this,
EventArgs.Empty);
1126a1136,1137
 >
 >                              public event EventHandler Saved;

<===================================================================>


In the featureclasses.cs, temporarily I change line number 896 to the
following line to resolve circular dependency issue.

public IEnumIDs IDs { get { return null; } }


The projects compiling order is as follows:
1. postgis_connector
2. postgis_helpers
3. postgis_geodatabase (with temporary changes)
4. postgis_cursors
5. postgis_featurecursor
6. postgis_geodatabase

After succesfully compile the projects, then I register
postgis_geodatabase assembly using the following command line:

regasm postgis_geodatabase.dll /tlb:postgis_geodatabase.tlb /codebase /v

The bad news is, I get a memory read error at the following line:

Private Sub UIButtonControl1_Click()
     Dim wksf As IWorkspaceFactory
     Set wksf = New CPostGisWksFactory

     Dim fwks As IFeatureWorkspace
     Set fwks = wksf.OpenFromFile("D:\database_config.zig", 0)

     Dim fc As IFeatureClass
     Set fc = fwks.OpenFeatureClass("public.prov_indo")

     Dim featLayer As IFeatureLayer
     Set featLayer = New FeatureLayer
     Set featLayer.FeatureClass = fc      <===== ERROR
     featLayer.Name = fc.AliasName

     Dim pMxDoc As IMxDocument
     Set pMxDoc = Application.Document
     pMxDoc.AddLayer featLayer
End Sub

Abe, do you have any idea what is the problem? Do I miss something?

Rgds,
Roy Irwan
_______________________________________________
Ziggis-devel mailing list
Ziggis-devel at avoir.uwc.ac.za
http://avoir.uwc.ac.za/mailman/listinfo/ziggis-devel



More information about the postgis-users mailing list