Original User: eddy scheperHello Lance,I did some tests using a part of your code (see below).
int main()
{
long hr;
wstring errorText;
// Open the geodatabase.
Geodatabase geodatabase;
if ((hr = OpenGeodatabase(L"C:/Project/Mpt/Data/TestFileGeodatabase10.gdb", geodatabase)) != S_OK)
{
wcout << "An error occurred while opening the geodatabase." << endl;
ErrorInfo::GetErrorDescription(hr, errorText);
wcout << errorText << "(" << hr << ")." << endl;
return -1;
}
// Open the table.
Table table;
//if ((hr = geodatabase.OpenTable(L"\\basis2", table)) != S_OK)
//if ((hr = geodatabase.OpenTable(L"\\basis2xx", table)) != S_OK)
if ((hr = geodatabase.OpenTable(L"\\bodem5000", table)) != S_OK)
{
wcout << "An error occurred while opening the table." << endl;
ErrorInfo::GetErrorDescription(hr, errorText);
wcout << errorText << "(" << hr << ")." << endl;
return -1;
}
// Open the metadata.
string xml;
if ((hr = table.GetDocumentation(xml)) != S_OK)
{
wcout << "An error occurred while getting the metadata." << endl;
ErrorInfo::GetErrorDescription(hr, errorText);
wcout << errorText << "(" << hr << ")." << endl;
return -1;
}
cout << xml;
return 0;
}
These are my results.- Using the Feature Class \\basis2 >> OK, I get the metadata.- Using a non existent Feature Class \\basis2xx >> OK, I get a proper error message.- Using the Raster Dataset bodem5000 >> NOK, I get an windows error (in VS2010: Unhandled exception at 0x1038b235 (FileGDBAPID.dll) in MptFgdbExe.exe: 0xC0000005: Access violation reading location 0x00000000.).When using the following code instead, I get the proper metadata.
string xml;
if ((hr = geodatabase.GetDatasetDocumentation(L"\\bodem5000",L"Raster Dataset",xml)) != S_OK) {
wcout << "An error occurred while getting the metadata." << endl;
ErrorInfo::GetErrorDescription(hr, errorText);
wcout << errorText << "(" << hr << ")." << endl;
return -1;
}
I'm using the FileGeodatabase I send you today. It contains both the basis2 and bodem5000 datasets.Hopefully this helps to solve the problem.With kind regards,Eddy Scheper