Solved

Cant write IStream::Write due to insufficient disk space

Posted on 2002-05-06
6
1,058 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 Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now