[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Cant write IStream::Write due to insufficient disk space

Posted on 2002-05-06
6
Medium Priority
?
1,068 Views
Last Modified: 2012-05-04
Hi!
I'm working on VC++ on windows 2000.
Anyway I have used OpenStreamOnFile to get an IStream pointer to
an XML file. When I tried to write to the Istream it returned
Error: 0x80030070 - There is insufficient disk space.
There is no problem of disk space on my hard drive of course.
Anyone got a clue why IStream::Save is failing ?

The code goes like that:



HRESULT     hr = OpenStreamOnFile (MAPIAllocateBuffer, MAPIFreeBuffer,STGM_READ | STGM_WRITE, xmlFile, NULL, &pXmlStream);

char buff[100]="Hello";

LARGE_INTEGER li = {0, 0};
HRESULT _hh = pXmlStream->Seek(li,STREAM_SEEK_SET,NULL);
         
unsigned long  x;
hr  = pXmlStream->Write(buff,5,&x);


Thanks you.
0
Comment
Question by:ronibr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 6991422
You initialization of 'LARGE_INTEGER' seems a bit 'problematic' - try

__int64 i = 0;

LARGE_INTEGER li;

li.QuadPart = i;

HRESULT _hh = pXmlStream->Seek(li,STREAM_SEEK_SET,NULL);

BTW, you do not have to seek to the beginning of a file you open...
0
 

Author Comment

by:ronibr
ID: 6991430
Its not connected in any way to the pXmlStream->Seek.
HRESULT from seek is 0 (success) and even without
the Seek it fails with the same problem.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6991456
Hmm, is the file you are opening read-only? (Yes, it'd be a stupid error code, but...)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 49

Expert Comment

by:DanRollins
ID: 7044032
hi ronibr,
Are you still interested in solving this problem?  If so, post the failing code (the code that returns the error hr)  Writing to one of these kind of streams is trickier than it looks...

-- Dan
0
 
LVL 11

Expert Comment

by:griessh
ID: 7178518
Dear ronibr

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to

     "PAQ at zero points"

since you never gave more feedback.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 7199749
moved to PAQ

** Mindphaser - Community Support Moderator **
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question