Im writing an sprite class and I have ran into a problem.
In the red bold is my problem. I need to copy the bitmap that HBITMAP points to to another HBITMAP. I tried to simply dereference both hBitmaps so that it would copy the bitmap, and it compiles, but I get a runtime issue that just kicks me out when it reaches that line.
Does the winAPI have a function or something for copying a bitmap that an hbitmap points to into another hbitmap?
Thanks
Code:
CopiedSprite.sImage->SpritePos.x = (SelectedSprite.sImage->SpritePos.x + 20);
CopiedSprite.sImage->SpritePos.y = (SelectedSprite.sImage->SpritePos.y + 20);
[COLOR=red]*CopiedSprite.sImage->hBitmap = *SelectedSprite.sImage->hBitmap; [/color]
::GetObject(CopiedSprite.sImage->hBitmap, sizeof (BITMAP), &CopiedSprite.sImage->Bitmap);
CopiedSprite.sImage->hBitmap = SelectedSprite.sImage->hBitmap;
mImageRepository.push_back(CopiedSprite.sImage);
In the red bold is my problem. I need to copy the bitmap that HBITMAP points to to another HBITMAP. I tried to simply dereference both hBitmaps so that it would copy the bitmap, and it compiles, but I get a runtime issue that just kicks me out when it reaches that line.
Does the winAPI have a function or something for copying a bitmap that an hbitmap points to into another hbitmap?
Thanks