Click here to Skip to main content
15,907,687 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAuto update software Pin
includeh1028-Sep-09 5:29
includeh1028-Sep-09 5:29 
AnswerRe: Auto update software Pin
Moak28-Sep-09 6:08
Moak28-Sep-09 6:08 
AnswerRe: Auto update software Pin
Hans Dietrich28-Sep-09 11:51
mentorHans Dietrich28-Sep-09 11:51 
GeneralRe: Auto update software Pin
includeh1029-Sep-09 9:38
includeh1029-Sep-09 9:38 
QuestionHow To Get Images of Authentication code from Web Service By VC Pin
jeansea28-Sep-09 3:57
jeansea28-Sep-09 3:57 
AnswerRe: How To Get Images of Authentication code from Web Service By VC Pin
jeansea28-Sep-09 16:27
jeansea28-Sep-09 16:27 
QuestionCListCtrl question [SOLVED] Pin
sashoalm28-Sep-09 3:41
sashoalm28-Sep-09 3:41 
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 
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 
Acutura wrote:
It is a solution, but it os not very convenient.

Why is it not convenient? Do you mean "I don't like it"?


Acutura wrote:
I prefer the way it works in DELPHI. You change value of a property and change is instantly displayed.

Why bother?


Anyway, with a bit of extra work you may implement it in C++, for instance (doggy details & error checking left as exercise Roll eyes | :rolleyes: )

class NiceRectangle;

class RectWidth
{
  NiceRectangle * _pParent;
  int _iWidth;
public:
  RectWidth():_iWidth(0), _pParent(NULL){}
  RectWidth (NiceRectangle * pParent):_pParent(pParent),_iWidth(0){}

  RectWidth & operator = (int i);
  
  operator int(){ return _iWidth;}
};

class NiceRectangle
{
public:
  NiceRectangle():width(this){}
  RectWidth width;
  void OnWidthChange(){printf("new width is %d\n", (int) width);}
};


RectWidth & RectWidth::operator = (int i)
{
    _iWidth = i;
    _pParent->OnWidthChange();
    return *this;
}


void main()
{
  NiceRectangle nr;
  nr.width = 100;
}


Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

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 

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.