Click here to Skip to main content
15,884,353 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Create Mutiple Insatnces of same control Pin
Cedric Moonen17-Apr-06 20:57
Cedric Moonen17-Apr-06 20:57 
AnswerRe: Create Mutiple Insatnces of same control Pin
Parthiban17-Apr-06 21:10
Parthiban17-Apr-06 21:10 
QuestionParallel port and MFC application integration Pin
christinalimsw17-Apr-06 20:12
christinalimsw17-Apr-06 20:12 
AnswerRe: Parallel port and MFC application integration Pin
Branislav17-Apr-06 22:18
Branislav17-Apr-06 22:18 
QuestionProblem in - typeid - in Release version Pin
Sarvan AL17-Apr-06 18:48
Sarvan AL17-Apr-06 18:48 
AnswerRe: Problem in - typeid - in Release version Pin
Stephen Hewitt17-Apr-06 19:24
Stephen Hewitt17-Apr-06 19:24 
AnswerRe: Problem in - typeid - in Release version Pin
Maxwell Chen17-Apr-06 19:25
Maxwell Chen17-Apr-06 19:25 
GeneralRe: Problem in - typeid - in Release version Pin
Stephen Hewitt17-Apr-06 19:33
Stephen Hewitt17-Apr-06 19:33 
Most programming guidelines would go even further - Don't misuse dynamic_cast; use virtual functions instead.

Steve

-- modified at 1:35 Tuesday 18th April, 2006

i.e.
class CBaseView : public CView
{
    // Stuff removed here...
public:
    virtual bool CanClose() const = 0;
    // Stuff removed here...
};
 
class CMyView1 : public CBaseView
{
    // Stuff removed here...
public:
    virtual bool CanClose() const
    {
       return false;
    }
    // Stuff removed here...
}; // Same for CMyView2 and CMyView3.
 
class CMyOtherViews : public CBaseView
{
    // Stuff removed here...
public:
    virtual bool CanClose() const
    {
       return true;
    }
    // Stuff removed here...
}; // Same for all "closable" views.
 
// Now to test if it can be closed:
pView->CanClose();</code>


This is basic OO design and good use the C++'s features.
GeneralRe: Problem in - typeid - in Release version Pin
Sarvan AL17-Apr-06 20:12
Sarvan AL17-Apr-06 20:12 
AnswerRe: Problem in - typeid - in Release version Pin
David Crow18-Apr-06 3:02
David Crow18-Apr-06 3:02 
QuestionCHotKeyCtrl and "space" Pin
Abin17-Apr-06 17:50
Abin17-Apr-06 17:50 
AnswerRe: CHotKeyCtrl and "space" Pin
Branislav17-Apr-06 23:04
Branislav17-Apr-06 23:04 
QuestionHow to add drag/drop to the CTreeCtrl. Pin
megzhou17-Apr-06 17:45
megzhou17-Apr-06 17:45 
AnswerRe: How to add drag/drop to the CTreeCtrl. Pin
Hamid_RT17-Apr-06 19:46
Hamid_RT17-Apr-06 19:46 
QuestionHow to integrate the Simulink in the VC environment? Pin
megzhou17-Apr-06 17:26
megzhou17-Apr-06 17:26 
AnswerRe: How to integrate the Simulink in the VC environment? Pin
megzhou18-Apr-06 15:19
megzhou18-Apr-06 15:19 
QuestionHow to achieve this?? About zoomin/zoomout in CEditView or CEdit... Pin
figer17-Apr-06 16:25
figer17-Apr-06 16:25 
AnswerRe: How to achieve this?? About zoomin/zoomout in CEditView or CEdit... Pin
bob1697217-Apr-06 17:14
bob1697217-Apr-06 17:14 
AnswerRe: How to achieve this?? About zoomin/zoomout in CEditView or CEdit... Pin
bob1697217-Apr-06 17:34
bob1697217-Apr-06 17:34 
GeneralRe: How to achieve this?? About zoomin/zoomout in CEditView or CEdit... Pin
figer18-Apr-06 15:36
figer18-Apr-06 15:36 
GeneralRe: How to achieve this?? About zoomin/zoomout in CEditView or CEdit... Pin
figer18-Apr-06 18:38
figer18-Apr-06 18:38 
GeneralRe: How to achieve this?? About zoomin/zoomout in CEditView or CEdit... Pin
bob1697219-Apr-06 17:14
bob1697219-Apr-06 17:14 
Questionhow to integrate google with VC? Pin
includeh1017-Apr-06 15:58
includeh1017-Apr-06 15:58 
AnswerRe: how to integrate google with VC? Pin
ThatsAlok18-Apr-06 7:43
ThatsAlok18-Apr-06 7:43 
QuestionWindows Media Player Pin
Harshabhi17-Apr-06 15:23
Harshabhi17-Apr-06 15:23 

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.