Hi,
I am kinda new to MFC/OLE and whatnot.. I am stuck with IStream interface. I am trying to move files in a custom file system. Weirdly, when I try to move from one storage to another, it is instead creating a new file with the destination-storage pre-pended to the file name.
For example, if I am trying to move a file "xyz" in root to folder "temp", it is ending up re-naming xyz to tempxyz in the root folder instead of new path being temp/xyz.
Please help with what wrong with this piece of code :
CComPtr<IUnknown> destinationStorage;
GetStorage(newPath, &destinationStorage);
IStoragePtr destinationFolder;
destinationStorage->QueryInterface(__uuidof(IStoragePtr), (LPVOID*)&destinationFolder);
CComPtr<IUnknown> sourceStorage;
GetStorage(oldPath, &sourceStorage);
IStoragePtr sourceFolder;
sourceStorage->QueryInterface(__uuidof(IStoragePtr), (LPVOID*)&sourceFolder);
HRESULT hr = sourceFolder->MoveElementTo(_bstr_t(oldFile), destinationFolder,
_bstr_t(newFile), STGMOVE_MOVE);
GetStorage is a custom function and when I trace, both oldFile and newFile have SAME name and not the weird pre-prended name it ends up creating :|