Solved

Create a class from CBitmap

Posted on 2003-12-08
5
158 Views
Last Modified: 2013-11-20
I want to create a class called CMyBitmap which is derived from CBitmap, but when I select insert new class, there isn't such a base class for me to select in the combo box. How can I write the code? Actually what I want to do is to create a CMyBitmap class with some function like loadresource, getheight,getwidth and drawbmp in the class so that I can design the background of my dialog in an SDI application, but I face many problems in doing so. Hope someone can tell me how to write the code? (or is there an active x control for doing so?I try the picture box in the control editor but the picture will always cover my buttons). Need help urgently for my project. thanx in advance  



hueychian
a newbie in VC++
0
Comment
Question by:hueychian1983
  • 2
5 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 50 total points
ID: 9902692
create your own .cpp/.h files

in .h file
class CMyBitmap : public CBitmap
{
public:
CMyBitmap();
virtual ~CMyBitmap() {};
...override the functionality you want here
}

and in .cpp file
CMyBitmap(...) : CBitmap(...)
{
}

0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 11850412
My comment should provide the solution
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 85
Error on moodle after upgrade 3 120
Macro to save highlighted rows as a separate file 5 41
Path of Workbook 3 59
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now