IWorkspaceFactory->openfromfile , NULL result for Workspace output

01-27-2012 03:51 AM
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.


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

thanks for any help.
0 Kudos
2 Replies
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
New Contributor
Thank you very much, I have tried that, still NULL result !!!
0 Kudos