Click here to Skip to main content
15,898,876 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: CListCtrl question Pin
David Crow28-Sep-09 4:03
David Crow28-Sep-09 4:03 
AnswerRe: CListCtrl question Pin
sashoalm28-Sep-09 4:29
sashoalm28-Sep-09 4:29 
AnswerRe: CListCtrl question Pin
David Crow28-Sep-09 4:35
David Crow28-Sep-09 4:35 
Question32bit <---> 64bit Pin
David Crow28-Sep-09 3:29
David Crow28-Sep-09 3:29 
AnswerRe: 32bit <---> 64bit Pin
«_Superman_»28-Sep-09 5:57
professional«_Superman_»28-Sep-09 5:57 
AnswerRe: 32bit <---> 64bit Pin
Hans Dietrich28-Sep-09 11:40
mentorHans Dietrich28-Sep-09 11:40 
AnswerRe: 32bit <---> 64bit Pin
Rick York28-Sep-09 11:57
mveRick York28-Sep-09 11:57 
Questionperforming operations when assigning to class member in C++ Pin
Acutura28-Sep-09 1:46
Acutura28-Sep-09 1:46 
Hi,

I have following problem:

Suppose I have such class:

class NiceRectangle{
private:
Display dispHnd; //display handle

void DisplayRectangle(); // displays rectangle on screen

public:
unsigned int width; // dimensions
unsigned int height;
COLOR color; // interior color

unsigned int GetArea(); // return area
};


Is to it possible to perform some operations when I assign value to the width or height member.
Let`s say I write:

NiceRectangle nRect;
nRect.width = 100;

And when I assign 100 to nRect.width I want to perform instructions:
width = 100;
ShowDisplay(dispHand);
DrawFrame(width, height, Black);
...

and with
nect.height = 9;

I want to play a sound, open the fridge and finally assign 9 to height.


Another words, I want assigment operator = to act like function, but I want to be able to use it for any public member(variable).

I know it is possible to overload operator for a class, but I don`t want to overload an operator for a whole class, but only for its particular member.

I`ve heard about MFC which, I believe, performs similar tasks, but I want a more general solution, for example for linux.

Can this be done? How?

Thank You
AnswerRe: performing operations when assigning to class member in C++ Pin
Cedric Moonen28-Sep-09 1:55
Cedric Moonen28-Sep-09 1:55 
GeneralRe: performing operations when assigning to class member in C++ Pin
Acutura28-Sep-09 2:09
Acutura28-Sep-09 2:09 
GeneralRe: performing operations when assigning to class member in C++ Pin
Cedric Moonen28-Sep-09 2:18
Cedric Moonen28-Sep-09 2:18 
GeneralRe: performing operations when assigning to class member in C++ Pin
CPallini28-Sep-09 2:34
mveCPallini28-Sep-09 2:34 
GeneralRe: performing operations when assigning to class member in C++ Pin
Acutura28-Sep-09 19:44
Acutura28-Sep-09 19:44 
GeneralRe: performing operations when assigning to class member in C++ Pin
CPallini28-Sep-09 20:50
mveCPallini28-Sep-09 20:50 
AnswerRe: performing operations when assigning to class member in C++ Pin
CPallini28-Sep-09 2:12
mveCPallini28-Sep-09 2:12 
QuestionProblem using Windows FindFirstFile function and its related ones Pin
Danzy8328-Sep-09 1:02
Danzy8328-Sep-09 1:02 
AnswerRe: Problem using Windows FindFirstFile function and its related ones Pin
CPallini28-Sep-09 2:03
mveCPallini28-Sep-09 2:03 
Questionhow to Split a String ? [modified] Pin
omarko_hjw28-Sep-09 1:00
omarko_hjw28-Sep-09 1:00 
QuestionRe: how to Split Numeric , and String ? Pin
CPallini28-Sep-09 2:02
mveCPallini28-Sep-09 2:02 
AnswerRe: how to Split Numeric , and String ? Pin
Maximilien28-Sep-09 2:51
Maximilien28-Sep-09 2:51 
AnswerRe: how to Split a String ? Pin
CPallini28-Sep-09 3:02
mveCPallini28-Sep-09 3:02 
QuestionHow to use Windows FindFirstFile function and its related ones Pin
Danzy8328-Sep-09 0:59
Danzy8328-Sep-09 0:59 
QuestionRe: How to use Windows FindFirstFile function and its related ones Pin
CPallini28-Sep-09 1:59
mveCPallini28-Sep-09 1:59 
QuestionHow can create cab file for pocket pc? Pin
Le@rner28-Sep-09 0:29
Le@rner28-Sep-09 0:29 
AnswerRe: How can create cab file for pocket pc? Pin
«_Superman_»28-Sep-09 6:01
professional«_Superman_»28-Sep-09 6:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.