我正在从 C# 读取和写入结构化存储文件。打开我调用的文件
IStorage StorageInterface;
int result = StgOpenStorage(filename, null, STGM.READWRITE | STGM.SHARE_EXCLUSIVE, IntPtr.Zero, 0, out StorageInterface);
这有效,我可以访问该文件。我相信我需要在 Storage 对象上调用 Release() 来关闭文件。但是,自从在 IUnknown 上实施以来,我不知道如何到达 Release。
我可以将 StorageInterface 转换为实现 IUnknown 的对象并以这种方式调用它吗?
谢谢,
约翰