By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,994 Members | 2,090 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,994 IT Pros & Developers. It's quick & easy.

Using this objdct

P: n/a
I created a simple graphic and I store them in arrays of differnet
objects. I know that I am using windows libraries but my question has
nothing to do with that. Here is the heading of my graphic object:


#ifndef GRAPHIC_H
#define GRAPHIC_H

class graphic{
int btmap;
int lr,ud; //Diminsion (size) of the graphic
HBITMAP hbitmap;
HDC hdc, hdcmem;

graphic(BYTE c[]);
void SetGr(BYTE c[]);
void display(HWND, int, int);



And I want to use my graphic here:

graphic gr;

for(int l2 = 0; l2 < num; l2++){
for(int l1 = 0; l1 < num; l1++){
gr = maze->display(l2, l1); //get the gr object from the
gr.display(hwnd, l1*spacing, l2*spacing);
//calls the display function from the graphic.

Basicaly I want to return the graphic from the container. Do I need a
copy constructor or to overload = operator or do I need a copy
constructor? Basically how do I get this to work or how could I do
this better.

Apr 10 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.