[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Cant write IStream::Write due to insufficient disk space

Posted on 2002-05-06
6
Medium Priority
?
1,069 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
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

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!

Question has a verified solution.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

830 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