Tapan
May 18th, 1999, 09:36 PM
dear gurus,
i have been using the IStorage , IStream objects but have encountered exceptions.
i shall give a brief overview of my code
IStorage* pStorage;
HRESULT hr;
hr=StgCreateDocfile(
L"test2.stg",STGM_DIRECT|STGM_WRITE|STGM_SHARE_EXCLUSIVE|STGM_CREATE,NULL,&pStorage);
ULONG cbytes_written=0;
char pt[3]="hi";
IStream* pStream;
pStorage->CreateStream(L"layer1",
STGM_DIRECT | STGM_WRITE|STGM_CREATE ,0,0,&pStream);
pStream->Write(pt,strlen(pt),&cbytes_written);//i get an exception here
i get an exception in the last statement . can anyone tell me why? and how should i go about it?
also, here variable pt is a character , so the 2nd arguement in the Write function is strlen(pt), what if it was integer?
early help appreciated
i have been using the IStorage , IStream objects but have encountered exceptions.
i shall give a brief overview of my code
IStorage* pStorage;
HRESULT hr;
hr=StgCreateDocfile(
L"test2.stg",STGM_DIRECT|STGM_WRITE|STGM_SHARE_EXCLUSIVE|STGM_CREATE,NULL,&pStorage);
ULONG cbytes_written=0;
char pt[3]="hi";
IStream* pStream;
pStorage->CreateStream(L"layer1",
STGM_DIRECT | STGM_WRITE|STGM_CREATE ,0,0,&pStream);
pStream->Write(pt,strlen(pt),&cbytes_written);//i get an exception here
i get an exception in the last statement . can anyone tell me why? and how should i go about it?
also, here variable pt is a character , so the 2nd arguement in the Write function is strlen(pt), what if it was integer?
early help appreciated