We help IT Professionals succeed at work.
Get Started

help using CArrayBITMAP

flynny
flynny asked
on
462 Views
Last Modified: 2008-01-09
hi,

i'm trying to use the following links class to create and array of bitmaps loaded into memory.

however it doesn't seem to be adding it to the class. can anyone see what i'm doing wrong?

http://www.codeguru.com/cpp/g-m/bitmap/article.php/c4937/

heres my code for using it

            HBITMAP hBmp = (HBITMAP)::LoadImage(NULL,bmp,
                                 IMAGE_BITMAP,0,0,
                                 LR_LOADFROMFILE|LR_CREATEDIBSECTION);

            if(hBmp)
            {
                  CBitmap cBmp;
                  cBmp.FromHandle(hBmp);

                  int bmpPosition = array.Add(&cBmp);

                  if(bmpPosition != -1)
                  {
                  }
                  else
                  {
//is always -1 for some reason
                  }
            }

just to add i know the bitmap i pass does exist.

matt.
Comment
Watch Question
Senior Software Engineer (Avast)
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 34 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE