This worked for me
std::wstring fileExists(std::wstring name)
{
VARIANT_BOOL b = 0;
::CoInitialize(NULL);
{
CComPtr<IFileSystem> spFSO;
HRESULT hr = spFSO.CoCreateInstance(L"Scripting.FileSystemObject");
if (SUCCEEDED(hr) && spFSO)
{
BSTR theName = SysAllocStringLen( name.data(), name.size());
hr = spFSO->FileExists(theName, &b);
}
}
::CoUninitialize();
return (b == -1) ? L"Exists" : L"Doesn't exist";
}
That at least got me connected to the functionality. There's still the getting it right for the situation, but that's beyond the scope of the posting.