 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
kronos Guest
|
Posted: Thu Feb 15, 2007 3:36 pm Post subject: Questions about GlobalAlloc |
|
|
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
|
Posted: Thu Feb 15, 2007 8:54 pm Post subject: Re: Questions about GlobalAlloc |
|
|
"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
|
Posted: Thu Feb 15, 2007 11:36 pm Post subject: Re: Questions about GlobalAlloc |
|
|
"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
|
Posted: Fri Feb 16, 2007 9:10 am Post subject: Re: Questions about GlobalAlloc |
|
|
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 |
|
 |
|
|
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
|
|