Mar 2, 2022 at 9:34pm UTC
see these function that have an argument Pointer:
1 2 3 4 5 6 7
void GetDIBs(BYTE *Pixels)
{
int dwLen = bmi.bmiHeader.biWidth *bmi.bmiHeader.biHeight * (BitMap.bmBitsPixel / 8);
Pixels = (BYTE *)realloc(Pixels, dwLen);
memset(Pixels, 0, dwLen);
GetBitmapBits(hBitmap,dwLen,Pixels);
.............
the line:
Pixels = (BYTE *)realloc(Pixels, dwLen);
seems ignored.. why? i can't change the pointer size?
Last edited on Mar 2, 2022 at 9:39pm UTC
Mar 2, 2022 at 9:59pm UTC
What makes you think it is ignored?
Does Pixels point to the beginning of a memory block that was previously created with malloc/calloc/realloc?
Last edited on Mar 2, 2022 at 10:01pm UTC
Mar 2, 2022 at 10:04pm UTC
Note that Pixels is a copy of the pointer that was passed as argument to the GetDIBs function and modifying Pixels inside the function will not automatically update any pointer outside the function.
Last edited on Mar 2, 2022 at 10:05pm UTC
Mar 2, 2022 at 10:06pm UTC
is there a way for do it?
Mar 2, 2022 at 11:57pm UTC
void GetDIBs( BYTE*& Pixels )
Mar 3, 2022 at 9:13pm UTC
thank you so much. works fine.
and i tested that must be: "pointer adressed"(*&) and not "adressed pointer"(&*).
thank you so much for all to all