Customer Service | Training | Contact Us
You are here: Home > User Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - ArcObjects General forum

ShapefileWorkspaceFactory.Open Broken in 9....   Abram Gillespie May 01, 2007
Re: ShapefileWorkspaceFactory.Open Broken i...   Dheeraj Varshnay May 01, 2007
Re: ShapefileWorkspaceFactory.Open Broken i...   Abram Gillespie May 01, 2007
Report Inappropriate Content • Top • Print • Reply    
Subject ShapefileWorkspaceFactory.Open Broken in 9.2? 
Author Abram Gillespie 
Date May 01, 2007 
Message Prior to 9.2 I could open a shapefile workspace using the below code. But now I always get "Exception from HRESULT: 0x80040228" I've ensured the paths and such are correct. Is this an introduced bug or has something changed that hasn't been reflected in the developer help docs?

Thanks.

--
Abe Gillespie, abe@digital-pulp.com
Programmer for hire - GIS, Business Apps, Website Apps
http://code.google.com/p/ziggis/ 
 
PropertySet propSet = new PropertySetClass();
IWorkspaceFactory wksf = new ShapefileWorkspaceFactoryClass();
propSet.SetProperty("DATABASE", "c:\\somedir");
IFeatureWorkspace fwks = (IFeatureWorkspace)wksf.Open(propSet, 0);
 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: ShapefileWorkspaceFactory.Open Broken in 9.2? 
Author Dheeraj Varshnay 
Date May 01, 2007 
Message are you calling IAoInitialize.Initialize first to initialize the proper license ? In 9.2 it is required to intialize the license.


Public Sub New()

' This call is required by the Windows Form Designer.
InitializeComponent()
Dim iaoinit As AoInitialize
iaoinit = New AoInitializeClass()
If iaoinit.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeArcInfo) Then

iaoinit.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcInfo)
End If

' Add any initialization after the InitializeComponent() call.

End Sub 
  Thanks,
~D 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: ShapefileWorkspaceFactory.Open Broken in 9.2? 
Author Abram Gillespie 
Date May 01, 2007 
Message That was it! For the record I had to do it the as shown in the below code.

Thanks a ton!

--

Abe Gillespie, abe@digital-pulp.com
Programmer for hire - GIS, Business Apps, Website Apps
http://code.google.com/p/ziggis/ 
 
AoInitialize init = new AoInitializeClass();
if (init.IsProductCodeAvailable(esriLicenseProductCode.esriLicenseProductCodeArcView) ==
  esriLicenseStatus.esriLicenseAvailable)
  init.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcView);