Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM question 1

Status
Not open for further replies.

Cagliostro

Programmer
Sep 13, 2000
4,226
GB
Why I can't create a storage? I see there no errors...

OleInitialize(0);//the same error with CoInitialize
HRESULT hr;
IStorage* pStg;
hr=StgCreateDocfile(L"c:\\xxxx.tx",STGM_CREATE,0,&pStg);
if(FAILED(hr))
{
cout<<&quot;failed StgCreateDocfile&quot;<<endl;
}
OleUninitialize();
John Fill
1c.bmp


ivfmd@mail.md
 
The type of HRESULT error is STG_E_INVALIDFLAG - this means that the error comes from the flag combination you have specified.

It seems that it don't works alone.

Use for example, this flag combination instead. On my test project ir worked fine.

STGM_TRANSACTED | STGM_READWRITE| STGM_CREATE| STGM_SHARE_EXCLUSIVE

Hope this works on your computer, too s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top