🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6765

Re: Error when writing file

#6765
From: mike
Date: Wed, 20 Apr 2005 16:11
57 lines
2643 bytes
Bob,

Thanks for responding, I appreciate it.

The flow of this particular issue is as follows:

1- I am moving one spool file from a printer to another printer.
2- So I am reading from the spool file and then sending it on its way to the 
other printer.
3- The first thing I do is allocate a working buffer as follows.

FileBuffer = (char *)( GlobalAlloc( GPTR, 16384 ) );

4- Then I read the data into the working buffer and use the following to 
send it off using WritePrinter().

 nErr  =   ::WritePrinter( hPrinter,(LPVOID)FileBuffer, ReadSize, 
&WrittenSize)                    ;

The ReadSize above is obtained from the Reading of the file.

5- Once the file has been transferred I release the working buffer as 
follows.

 GlobalFree( (HGLOBAL) FileBuffer )                       ;

All checking of making sure StartDocPrinter(), etc has been completed when 
the file reading and writing actions start.

Now this seems to work for awhile, that is the transfer of the data works 
for a number of files, and then I get the error indicated

So I am a loss as to why the I would get the error message.

Any assistance you can provide would certainly help me in this.

Thanks

Mike




"Bob Gonder" <notbg@notmindspring.invalid> wrote in message 
news:a4c86151pajfdndsk6mt25u7jr4nh11hnv@4ax.com...
> mike wrote:
>
>>Hello, could someone assist me in this. I am getting an error code 8 ( 
>>from
>>GetLastError() ) when performing a WritePrinter(). This error indicates
>>ERROR_NOT_ENOUGH_MEMORY
>
> "Not enough storage is available to process this command"
>
> How big is cbBuf, and are you passing it properly?
>
> 
Technical Details
Message-ID: <4266745e@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4263fc8e@newsgroups.borland.com> <a4c86151pajfdndsk6mt25u7jr4nh11hnv@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2bc06fa753d04116
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "mike" <mfbrowne@earthlink.nnet>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4263fc8e@newsgroups.borland.com> <a4c86151pajfdndsk6mt25u7jr4nh11hnv@4ax.com>
Subject: Re: Error when writing file
Date: Wed, 20 Apr 2005 12:11:36 -0400
Lines: 59
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 68.204.189.169
Message-ID: <4266745e@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1114010718 68.204.189.169 (20 Apr 2005 08:25:18 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail