Article View: borland.public.cppbuilder.nativeapi
Article #7018Re: Memory problems: new versus GlobalAlloc
From: Wim Bekker
Date: Wed, 23 Mar 2005 09:53
Date: Wed, 23 Mar 2005 09:53
36 lines
2142 bytes
2142 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote: > Which documentation are you referring to? Documentation about Borlands memory manager and GlobalAlloc etc. Documentation that explains the WinApi in detail (alignment etc). >> How come SetStretchBltMode doesn't work good when using >> memory allocated with new but works fine with memory allocated >> with GlobalAlloc? Here I made a copy/paste error. I do use SetStretchBltMode just before using StretchDIBits to render the bits. > The type of memory should not matter at all. Especially considering that > SetStretchBltMode() does not accept a memory block as input to begin with, > only an HDC and an int. StretchDIBits does. >My guess would be the error is elsewhere in your > code. What does GetLastError() return when SetStretchBltMode() returns a > value of 0? What does your code actually look like? If StretchDIBits returns 0 (0 scanlines copied), GetLastError returns 0 (all is ok). > What does your code actually look like? I will post my project (40KB) in attachments with some more comment. Wim
Technical Details
Message-ID:
<42413c01$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!tdsnet-transit!newspeer.tds.net!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42403f3c@newsgroups.borland.com> <42408062$3@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6b3a605b9bc38024 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Wim Bekker" <no-no-no-mail@no-no-noware.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <42403f3c@newsgroups.borland.com> <42408062$3@newsgroups.borland.com> Subject: Re: Memory problems: new versus GlobalAlloc Date: Wed, 23 Mar 2005 10:53:55 +0100 Lines: 38 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: 82.161.70.62 Message-ID: <42413c01$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1111571457 82.161.70.62 (23 Mar 2005 01:50:57 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!tdsnet-transit!newspeer.tds.net!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail