IWorkspaceFactory->openfromfile , NULL result for Workspace output

753
2
01-27-2012 03:51 AM
nazerehnejatbakhsh
New Contributor
Hey all,

I tried sample codes to open a File GDB Workspace which already exists with the name testGDB.gdb:
there is also a sample in EDN, I have ArcGIS 10, Visualstudio 2008.
I always get NULL result for the variable "outWorkspace", that is why I cant get any pointer to create a feature class inside the GDB.
Is there something I am missing !? any hint !????
I have checked several times, there is no problem with my path ! because the testGDB.gdb is created directly by ArcGIS
connString is in my case : C:\Daten\Bearbeitung\testGDB.gdb which goes with the codes.

http://resources.esri.com/help/9.3/arcgisdesktop/com/samples/Geodatabase/Accessing_Data/07EA5491-885...

HRESULT openFGDBWorkspace(BSTR connString, IWorkspace** outWorkspace)
{
      IWorkspaceFactoryPtr ipWorkspaceFactory(CLSID_FileGDBWorkspaceFactory);
      return ipWorkspaceFactory->OpenFromFile(connString, NULL, outWorkspace);
}

thanks for any help.
Nazereh
0 Kudos
2 Replies
sapnas
by
Occasional Contributor III
I'm not a vc++ programmer but I'm guessing that the file format assigned to connString may be incorrect. Have you tried using L"C:\\Daten\\Bearbeitung\\testGDB.gdb".
0 Kudos
nazerehnejatbakhsh
New Contributor
Thank you very much, I have tried that, still NULL result !!!
0 Kudos