3,245
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#include<objbase.h>
#pragma comment(lib,"ole32")
int main(void){
IStorage* pStg;
HRESULT ret=StgCreateDocfile(L"e:\\myfile",STGM_CREATE,0,&pStg);
printf("hr=%d\n",ret);
return 0;
}
#include "stdafx.h"
#include<stdio.h>
#include<objbase.h>
#pragma comment(lib,"ole32")
const OLECHAR fn[]=L"d:\\myfile";
int main(void){
IStorage* pStg;
HRESULT ret=StgCreateDocfile(fn,STGM_SHARE_EXCLUSIVE|STGM_CREATE|STGM_READWRITE,0,&pStg);
printf("hr=%ld,error=%d\n",ret,GetLastError());
if(pStg)pStg->Release();
VERIFY(S_OK==StgIsStorageFile(fn));
return 0;
}
#include "stdafx.h"
#include<stdio.h>
#include<objbase.h>
#pragma comment(lib,"ole32")
int main(void){
IStorage* pStg;
HRESULT ret=StgCreateDocfile(L"d:\\myfile",STGM_CREATE,0,&pStg);
printf("hr=%ld,error=%d\n",ret,GetLastError());
if(pStg)pStg->Release();
return 0;
}