How to use the File Geodatabase API c++ libraries into .NET Projects?

3396
6
01-21-2011 02:12 AM
Francisco_J_RP
New Contributor
Dear friends,

I need to use the Geodatabase File API c++ libraries into my .NET applications.

What are the tasks that we need to make use of these?

Thanks in advanced.

Francisco J.
0 Kudos
6 Replies
Patrickvan_Dijk
New Contributor
There is two ways you can accomplish this
1) Create a DLL from this LIB in which you expose a certain API you like.
Then from .NET use P/Invoke to you custom DLL.
2) Create a Mixed Mode DLL containing both Native and .NET instructions.
Most of the times I prefer to use a Mixed Mode DLL.

Regards,

Patrick
0 Kudos
Francisco_J_RP
New Contributor
Dear Patrick, many thanks for your reply.

Do you know any sample applied to any LIB to learn how can I apply to the Geodatabase API Lib?

I'm a recently .NET programmer and I don't have any knowledge about C++ programming and interoperability with .NET languages.

If I don't have access to the source code except the headers files with the scheme of functions, methods, ... Can I use your methodology to get access to custom object as geodatabase, rows, features, ...?

Thanks in advanced.

Francisco J.
0 Kudos
MarcBate
Occasional Contributor II
Ditto.  I'd like an API I can use with .NET and ArcGIS Explorer, for example, that allows me to read/write feature classes in a file GDB with my plug-in.
0 Kudos
DonnyVelazquez
Occasional Contributor
I created an example project that is a CLR C++ wrapper for the FileGDAPI. You can use it from any DotNet language to access the api. That should get the ball moving.

http://code.google.com/p/filegdbapi-dotnet-example/
0 Kudos
PrateekBansal
New Contributor
Hey ,

I tried using the sample project but whenever I try to open or create a geodatabase I get this error

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Any Idea how this can be resolved ?

Thanks
Prateek
0 Kudos
LanceShipman
Esri Regular Contributor
We will be releasing a .NET Wrapper sometime in the next week or two. Watch the geodatabase blog for the announcement.

http://blogs.esri.com/Dev/blogs/geodatabase/default.aspx
0 Kudos