int CreateFileGDB(std::wstring filegdbPath,std::wstring filegdbName,Geodatabase &newFGDB)
{
fgdbError hr;
wstring errorText;
Geodatabase geodatabase;
wstring fgdb;
fgdb.empty();
fgdb.append(filegdbPath);
fgdb.append(L"/");
fgdb.append(filegdbName);
//Try to delete exist the same filegdb
hr = DeleteGeodatabase(fgdb);
if (hr == S_OK)
{
wcout << "Find the GDB exist,then the origin geodatabase has been deleted" << endl;
}
else if (hr == -2147024893)
{
wcout << "The geodatabase does not exist, no need to delete" << endl;
}
else
{
wcout << "An error occurred while deleting the geodatabase." << endl;
ErrorInfo::GetErrorDescription(hr, errorText);
wcout << errorText << "(" << hr << ")." << endl;
return -1;
}
// Create a new geodatabase in the parameter Path.
if ((hr = CreateGeodatabase(fgdb, geodatabase)) != S_OK)
{
wcout << "An error occurred while creating the geodatabase." << endl;
ErrorInfo::GetErrorDescription(hr, errorText);
wcout << errorText << "(" << hr << ")." << endl;
return -1;
}
wcout << "The geodatabase has been created." << endl;
newFGDB = geodatabase;
return 0;
}In this code the error exist in line "newFGDB = geodatabase".the error is : IntelliSense: "FileGDBAPI::Geodatabase &FileGDBAPI::Geodatabase::operator=(const FileGDBAPI::Geodatabase &)" (code the line: 283,belong file: "F:\SoftWare\ArcGIS\FileGDB_API_VS2010_1_0Final\samples\..\include\Geodatabase.h") thanks very much!