ESRI GeoDatabase issue - non-issue for New ShapefileWorkspaceFactory keyword

422
2
Jump to solution
09-05-2012 09:45 AM
CraigGraham
New Contributor III
Good Afternoon,
I was getting a "user-defined type not defined" error at compile time on the following line:

Dim pWSF as IWorkspaceFactory2 set pWSF = New ShapefileWorkspaceFactory


When I looked at IWorkpaceFactory2 in help it says it is in the esriGeoDatabase library.  I always had the reference to that library selected.  (I tried IWorkspaceFactory as well and got the same error).

I have many programs where I use this line, so I have opened a few of them and they compiled fine. 

After comparing the list of referenced libraries from the working and not working projects I found the one not working didnt have a reference to ESRI Editor EXT, ESRI GeoAnalyst, Microsoft ActiveX Data Objects 2.8, while the one that worked did.  Also the one that was not compiling had references to a bunch of libraries with GeoDatabase in the name, but the one that compiles did not.

I made the switches where necessary and now both compile.  BUT what library is the "shapefileworkspacefactory" keyword in, and why would it not be with the library that the associated object is in?  Finally, how did I figure this out before, and why has it not been an issue until now?  I am thinking the answer to my last question is more a case of just happening to need random other objects from the libraries I was not referring to until now...

If anyone has any ideas, comments, experience on this  I'd love to hear them.  Especially if you know a more effeicent troubleshooting routine.

Take care,
Craig

Setup:
ArcGIS 9.3.1 with networked license server (ArcINFO license, most ESRI extensions available)
VB 6.0
Windows XP Pro 32bit
0 Kudos
1 Solution

Accepted Solutions
NeilClemmons
Regular Contributor III
The IWorkspaceFactory and IWorkspaceFactory2 interfaces are included in the esriGeodatabase library.  The ShapefileWorkspaceFactory class is included in the esriDataSourcesFile library.  The developer help will tell you which library an interface or class belongs to.  There is also a Library Locator tool that installs to the ArcGIS\Developer Tools program group on your Start menu.

View solution in original post

0 Kudos
2 Replies
NeilClemmons
Regular Contributor III
The IWorkspaceFactory and IWorkspaceFactory2 interfaces are included in the esriGeodatabase library.  The ShapefileWorkspaceFactory class is included in the esriDataSourcesFile library.  The developer help will tell you which library an interface or class belongs to.  There is also a Library Locator tool that installs to the ArcGIS\Developer Tools program group on your Start menu.
0 Kudos
CraigGraham
New Contributor III
Thanks Neil.
I was wondering which library it was but got too busy to go back and check after I got it working.

I don't know why I didn't think to look for ShapefileWorkspaceFactory in the help.  Just getting to used to being able to get help with F1.  And of course since the reference wasn't set I was getting keyword not found in the MS Help.  Plus everyday this week has been like a Monday.

Thanks again,
Craig

PS: how do I mark your post as "the answer"?
0 Kudos