Solved

Cant write IStream::Write due to insufficient disk space

Posted on 2002-05-06
6
1,063 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
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 goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

809 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