Article View: borland.public.cppbuilder.internet.web
Article #1242Re: Active Server Object PART 2
From: melk
Date: Wed, 30 Mar 2005 12:13
Date: Wed, 30 Mar 2005 12:13
61 lines
2711 bytes
2711 bytes
Thank you it works right!!
I'm finding a lots of difficulty to try without debuging... do you now if
there is some method to debug this kind of object?
Thanks again!!
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> ha scritto nel messaggio
news:424458ef$1@newsgroups.borland.com...
>
> "melk" <NOSPAMi_melk@libero.it> wrote in message
> news:42443927@newsgroups.borland.com...
>
> > Hi Thanks for your replay, I tried to use but it seems doesn't work!!!
>
> Just saying it doesn't work says nothing about the actual problem you are
> having.
>
> > the first time I tried to use it, it gave me a memory write
> > error so I only add a line to malloc "data" before memcpy...
>
> That was not the correct thing to do.
>
> > I olso tried to write to file the "data" buffer whitout pass from the
> > "SafeArrayAccessData(v.parray, &data)" function and it write
> > the picture file well!!!
>
> You allocated memory for the buffer yourself instead of letting
> SafeArrayAccessData() do it for you.
>
> > Graphics::TBitmap *bmp = new Graphics::TBitmap();
> > TJPEGImage *jpg = new TJPEGImage();
>
> Wrap those in try...catch or try..finally blocks, or use an std::auto_ptr,
> to ensure the memory is freed correctly in case an exception occurs.
>
> > SAFEARRAYBOUND bounds = {0, MemStream->Size-1};
>
> Change that to this instead:
>
> SAFEARRAYBOUND bounds;
> bounds.lLbound = 0;
> bounds.cElements = MemStream->Size;
>
> > data = malloc(sizeof(byte)*MemStream->Size);
>
> Get rid of that.
>
> > Response->End();
>
> You don't need to call that since Flush() is called later.
>
> > free(data);
>
> Get rid of that.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<424a9805@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4242c7fd@newsgroups.borland.com> <42431956$1@newsgroups.borland.com> <42443927@newsgroups.borland.com> <424458ef$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,1b87c7406bae033 X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit From: "melk" <NOSPAMi_melk@libero.it> Newsgroups: borland.public.cppbuilder.internet.web References: <4242c7fd@newsgroups.borland.com> <42431956$1@newsgroups.borland.com> <42443927@newsgroups.borland.com> <424458ef$1@newsgroups.borland.com> Subject: Re: Active Server Object PART 2 Date: Wed, 30 Mar 2005 14:13:46 +0200 Lines: 63 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478 NNTP-Posting-Host: 81.208.118.242 Message-ID: <424a9805@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1112184837 81.208.118.242 (30 Mar 2005 04:13:57 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail