Click here to Skip to main content
15,921,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: window's init message ? Pin
PJ Arends2-Aug-02 21:53
professionalPJ Arends2-Aug-02 21:53 
GeneralRe: window's init message ? Pin
Nish Nishant2-Aug-02 22:02
sitebuilderNish Nishant2-Aug-02 22:02 
GeneralRe: window's init message ? Pin
includeh102-Aug-02 22:49
includeh102-Aug-02 22:49 
GeneralRe: window's init message ? Pin
ColinDavies2-Aug-02 21:55
ColinDavies2-Aug-02 21:55 
GeneralURL for bmp to jpeg Pin
suresh_sathya2-Aug-02 20:13
suresh_sathya2-Aug-02 20:13 
GeneralRe: URL for bmp to jpeg Pin
Chris Losinger2-Aug-02 20:18
professionalChris Losinger2-Aug-02 20:18 
GeneralRe: URL for bmp to jpeg Pin
-Dy5-Aug-02 0:41
-Dy5-Aug-02 0:41 
QuestionCPP question??? Pin
alex.barylski2-Aug-02 20:00
alex.barylski2-Aug-02 20:00 
I am trying to use a PVOID to store a dynamic array of pointers to various objects which will change from time to time so static casts won't work I don't think.

For example I have created a pure virtual base class which all objects SHOULD derive from if they wish to be added to the PVOID memory mentioned above.

Initially I tried using the base class as a cast and paramters for functions.

AddObject(CGenericItem* pItem)
{
    static UINT nIndex = 0;                          
    // m_pStack is a PVOID member of this class
    *(m_pStack+nIndex) = (PVOID)pItem;	                      
    nIndex++;
}


The above doesn't work? I'm getting a void * 'unknown size' WTF | :WTF: does that mean...??? I figured any pointer would be 4 bytes or does it mean the size of the object..???

static casts won't work because the object passed to the above function will never be the same object (ALL derived from the same base, but not the same final class)

So:

*(m_pStack+nIndex) = (UINT)pItem;


or something to that effect isn't gonna do...

Is there any way I can use RTTI and determine the class of the object and perform a cast at run time using dynamic_cast???

Thanx alot

cheers Poke tongue | ;-P

"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
AnswerRe: CPP question??? Pin
Chris Losinger2-Aug-02 20:07
professionalChris Losinger2-Aug-02 20:07 
GeneralRe: CPP question??? Pin
alex.barylski2-Aug-02 20:49
alex.barylski2-Aug-02 20:49 
GeneralRe: CPP question??? Pin
Christian Graus2-Aug-02 21:08
protectorChristian Graus2-Aug-02 21:08 
GeneralRe: CPP question??? Pin
alex.barylski2-Aug-02 22:30
alex.barylski2-Aug-02 22:30 
GeneralRe: CPP question??? Pin
Chris Losinger3-Aug-02 5:07
professionalChris Losinger3-Aug-02 5:07 
GeneralProblem in Detecting System Idle time Pin
Prateeti2-Aug-02 19:38
Prateeti2-Aug-02 19:38 
QuestionPlug in architecture - how to create a good one? Pin
Hiusing2-Aug-02 17:45
Hiusing2-Aug-02 17:45 
AnswerRe: Plug in architecture - how to create a good one? Pin
Chris Losinger2-Aug-02 20:12
professionalChris Losinger2-Aug-02 20:12 
GeneralCDhtmlDialog (VS.NET) Pin
Roman Nurik2-Aug-02 17:34
Roman Nurik2-Aug-02 17:34 
GeneralRe: CDhtmlDialog (VS.NET) Pin
ColinDavies2-Aug-02 21:14
ColinDavies2-Aug-02 21:14 
GeneralMDI question Pin
RK_20002-Aug-02 17:18
RK_20002-Aug-02 17:18 
GeneralRe: MDI question Pin
Pavel Klocek3-Aug-02 2:46
Pavel Klocek3-Aug-02 2:46 
QuestionSQL anyone? Pin
nss2-Aug-02 17:08
nss2-Aug-02 17:08 
AnswerRe: SQL anyone? Pin
RK_20002-Aug-02 17:15
RK_20002-Aug-02 17:15 
GeneralRe: SQL anyone? Pin
nss2-Aug-02 18:16
nss2-Aug-02 18:16 
GeneralRe: SQL anyone? Pin
RK_20002-Aug-02 18:26
RK_20002-Aug-02 18:26 
GeneralRe: SQL anyone? Pin
nss2-Aug-02 18:25
nss2-Aug-02 18:25 

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.