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

C / C++ / MFC

 
GeneralRe: CRectTracker on CScrollView Pin
mesajflaviu10-Aug-10 10:19
Membermesajflaviu10-Aug-10 10:19 
QuestionBoost Library Pin
002comp10-Aug-10 0:40
Member002comp10-Aug-10 0:40 
AnswerRe: Boost Library Pin
Niklas L10-Aug-10 1:01
MemberNiklas L10-Aug-10 1:01 
GeneralRe: Boost Library Pin
002comp10-Aug-10 2:48
Member002comp10-Aug-10 2:48 
GeneralRe: Boost Library Pin
Niklas L10-Aug-10 2:58
MemberNiklas L10-Aug-10 2:58 
GeneralRe: Boost Library Pin
002comp10-Aug-10 18:02
Member002comp10-Aug-10 18:02 
GeneralRe: Boost Library Pin
Niklas L10-Aug-10 22:13
MemberNiklas L10-Aug-10 22:13 
Questionany idea for "auto-cast"ing? Pin
includeh1010-Aug-10 0:24
Memberincludeh1010-Aug-10 0:24 
Let me use example to describe what I need:
class Top
{
public:
virtual void something()=0;
int iType;
};

class SubA : public Top
{
public:
SubA() {iType=0;}
virtual void something(){}
};

class SubB : public Top
{
public:
SubB() {iType=1;}
virtual void something(){}
};

CArray<Top*,Top*> aryTop;


aryTop contains a set of pointers to SubA and/or SubB.

I need to cast Top* in the array to correct sub class, that is, an auto_cast() may return SubA* or SubB* by value of iType. auto_cast() may be macro, function or any idea.
i.e.
Top*p=aryTop.GetAt(0); //OK, a pointer to SubA actually.
SubA*pa=auto_cast(p);     //OK, because iType of p is 0
SubB*pb=auto_cast(p);    //Error, because iType of p is not 1


Do you have idea to do so?
AnswerRe: any idea for "auto-cast"ing? Pin
Sauro Viti10-Aug-10 0:44
professionalSauro Viti10-Aug-10 0:44 
AnswerRe: any idea for "auto-cast"ing? Pin
CPallini10-Aug-10 0:45
mveCPallini10-Aug-10 0:45 
AnswerRe: any idea for "auto-cast"ing? Pin
Aescleal10-Aug-10 1:29
MemberAescleal10-Aug-10 1:29 
GeneralRe: any idea for "auto-cast"ing? Pin
Chris Losinger10-Aug-10 5:29
professionalChris Losinger10-Aug-10 5:29 
GeneralRe: any idea for "auto-cast"ing? Pin
Aescleal10-Aug-10 5:59
MemberAescleal10-Aug-10 5:59 
GeneralRe: any idea for "auto-cast"ing? Pin
Chris Losinger10-Aug-10 6:09
professionalChris Losinger10-Aug-10 6:09 
GeneralRe: any idea for "auto-cast"ing? Pin
Aescleal10-Aug-10 10:11
MemberAescleal10-Aug-10 10:11 
GeneralRe: any idea for "auto-cast"ing? Pin
Chris Losinger10-Aug-10 10:33
professionalChris Losinger10-Aug-10 10:33 
GeneralRe: any idea for "auto-cast"ing? Pin
Aescleal10-Aug-10 19:53
MemberAescleal10-Aug-10 19:53 
GeneralRe: any idea for "auto-cast"ing? Pin
Moak10-Aug-10 23:33
MemberMoak10-Aug-10 23:33 
GeneralRe: any idea for "auto-cast"ing? Pin
Chris Losinger11-Aug-10 1:08
professionalChris Losinger11-Aug-10 1:08 
QuestionLINK : fatal error LNK1104: cannot open file 'MyCplusplusWithSTL.lib' after converting VS2008 to VS2010 Pin
Chesnokov Yuriy9-Aug-10 22:43
professionalChesnokov Yuriy9-Aug-10 22:43 
AnswerRe: LINK : fatal error LNK1104: cannot open file 'MyCplusplusWithSTL.lib' after converting VS2008 to VS2010 Pin
Richard MacCutchan10-Aug-10 0:01
mveRichard MacCutchan10-Aug-10 0:01 
GeneralRe: LINK : fatal error LNK1104: cannot open file 'MyCplusplusWithSTL.lib' after converting VS2008 to VS2010 Pin
Chesnokov Yuriy10-Aug-10 0:17
professionalChesnokov Yuriy10-Aug-10 0:17 
GeneralRe: LINK : fatal error LNK1104: cannot open file 'MyCplusplusWithSTL.lib' after converting VS2008 to VS2010 Pin
Richard MacCutchan10-Aug-10 0:46
mveRichard MacCutchan10-Aug-10 0:46 
GeneralRe: LINK : fatal error LNK1104: cannot open file 'MyCplusplusWithSTL.lib' after converting VS2008 to VS2010 Pin
Chesnokov Yuriy10-Aug-10 0:56
professionalChesnokov Yuriy10-Aug-10 0:56 
GeneralRe: LINK : fatal error LNK1104: cannot open file 'MyCplusplusWithSTL.lib' after converting VS2008 to VS2010 Pin
Richard MacCutchan10-Aug-10 1:40
mveRichard MacCutchan10-Aug-10 1:40 

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.