int _tmain(int argc, _TCHAR* argv[]) { CoInitialize(0); ESRI_SET_VERSION(esriArcGISDesktop); CComBSTR srcPath; char path[] = "C:/points/Points_10000.shp"; HRESULT hr = GetParentDirFromFullPath(path, &srcPath); CComBSTR targetWorkspacePath = L"C:\\Users\\matt.moyles\\Documents\\Visual Studio 2008\\Projects\\PointBenchmarksStandalone\\Debug"; IWorkspaceFactoryPtr sourceWorkspaceFactory(CLSID_ShapefileWorkspaceFactory); IWorkspacePtr sourceWorkspace; hr = sourceWorkspaceFactory->OpenFromFile(srcPath, NULL, &sourceWorkspace); if( FAILED(hr) || sourceWorkspace == 0 ) { std::wcerr << L"Couldn't open workspace " << (BSTR) srcPath << std::endl; return 1; } ShutdownApp(); CoUninitialize(); return 0; }