BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Questions about GlobalAlloc

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
kronos
Guest





PostPosted: Thu Feb 15, 2007 3:36 pm    Post subject: Questions about GlobalAlloc Reply with quote



i've two questions about GlobalAlloc:

1. to free memory alloc, when i use GlobalAlloc, do i must use GloabalFree?

2. Do the "new" function problem involve only GDI function? and about
GDI+ function?

Many thanks.
Back to top
Bruce Salzman
Guest





PostPosted: Thu Feb 15, 2007 8:54 pm    Post subject: Re: Questions about GlobalAlloc Reply with quote



"kronos" <jhdhjsd.sdhjhdssu (AT) sdhdjsh (DOT) dgh> wrote in message
news:45d42979 (AT) newsgroups (DOT) borland.com...
Quote:
i've two questions about GlobalAlloc:

1. to free memory alloc, when i use GlobalAlloc, do i must use
GloabalFree?

Yes, pass the memory handle to GlobalFree.


Quote:
2. Do the "new" function problem involve only GDI function? and
about GDI+ function?


Don't know, but I assume the worst. :^)

--
Bruce
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Feb 15, 2007 11:36 pm    Post subject: Re: Questions about GlobalAlloc Reply with quote



"kronos" <jhdhjsd.sdhjhdssu (AT) sdhdjsh (DOT) dgh> wrote in message
news:45d42979 (AT) newsgroups (DOT) borland.com...

Quote:
to free memory alloc, when i use GlobalAlloc, do i must use
GloabalFree?

Yes.

Quote:
Do the "new" function problem involve only GDI function? and
about GDI+ function?

What are you talking about?


Gambit
Back to top
kronos
Guest





PostPosted: Fri Feb 16, 2007 9:10 am    Post subject: Re: Questions about GlobalAlloc Reply with quote

Remy Lebeau (TeamB) ha scritto:
Quote:
Do the "new" function problem involve only GDI function? and
about GDI+ function?

What are you talking about?


You're right i mixed two different issues:

1. "new" function and GDI function
When i tried to understand the problem about Leunen's 32-bit Bitmap
Rotate routine i saw the following strange behaviour:

Inverting the execution order of the following instruction

//Allocate memory for the bits
char* srcbits=new char[srcBmpi->bmiHeader.biSizeImage];

//Allocate memory for the bits
char* destbits=new char[destBmpi->bmiHeader.biSizeImage];


the

SetDIBits(ScreenDC,DestBitmap->Handle,0,
destBmpi->bmiHeader.biHeight,destbits,destBmpi,DIB_RGB_COLORS);

instruction fail or succeed though srcbits and destbits pointer were not
NULL!!


What is the function wrong? Is it "new" or "SetDIBits" function?

Or maybe are the "new" and "SetDIBits" unsuited between their?

Are there other cases where the "new" function do not work properly?



2. "new" function and GDI+ function
Is there the same problem between "new" function and "SetDIBits" GDI+
function?

I hope i've been more straightforward, anyway sorry for my english!

Many thanks
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.