Click here to Skip to main content
16,005,339 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralVS.Net install error Pin
Francis2317-May-02 1:14
Francis2317-May-02 1:14 
QuestionHow show string in system tray ?? Pin
Alexei Nazemnov17-May-02 1:06
Alexei Nazemnov17-May-02 1:06 
GeneralActiveX Pin
Tzoockee17-May-02 0:09
Tzoockee17-May-02 0:09 
GeneralRe: ActiveX Pin
Chris Losinger17-May-02 5:06
professionalChris Losinger17-May-02 5:06 
GeneralClosing Deskbands Pin
16-May-02 23:53
suss16-May-02 23:53 
GeneralGet selected item in a list control Pin
Nnamdi Onyeyiri16-May-02 23:11
Nnamdi Onyeyiri16-May-02 23:11 
GeneralRe: Get selected item in a list control Pin
Nish Nishant16-May-02 23:36
sitebuilderNish Nishant16-May-02 23:36 
QuestionPointer question? Pin
16-May-02 22:56
suss16-May-02 22:56 
Hi, everyone,

Recently I am thinking of using one pointer to access two different class. I don't know how to do this.

Here is the detail description:

I've a document class CMyDoc with a view class CCView.
In CCView's OnDraw function, I want to use one pointer pDoc->pCurImage to draw a image (eg. pDoc->pCurImage->Draw()). Because the two image buffer class are similar. They both have a draw function(and a lot of other function except their data type are diferrent). When I load an image from a file, the color image will be loaded into the color buffer(m_ColorImage), and the gray scale image will be loaded into the B/W buffer(m_BWImage), then a pointer m_pCurImage will pointer to the correct image buffer for the view class to display it.

But since the pointer type is (void*), how can a view class to use it.
Or is there any other elegant way to do the same job?

class CMyDoc : public CDocument
{
protected: // create from serialization only
CMyDoc();
DECLARE_DYNCREATE(CMyDoc)

public:
CBWImage m_BWImage;
CColorImage m_ColorImage;
void* m_pCurImageBuf;
...
...
...
}

Is their anybody can help? Any comments are greatly appreciated!

Best Regards,
Wayne King,
17 May 2002

AnswerRe: Pointer question? Pin
markkuk16-May-02 23:21
markkuk16-May-02 23:21 
AnswerRe: Pointer question? Pin
Nish Nishant16-May-02 23:33
sitebuilderNish Nishant16-May-02 23:33 
GeneralRe: Pointer question? Pin
19-May-02 15:58
suss19-May-02 15:58 
GeneralSluggishness Pin
LittleYellowBird16-May-02 22:48
LittleYellowBird16-May-02 22:48 
GeneralRe: Sluggishness Pin
PJ Arends16-May-02 23:45
professionalPJ Arends16-May-02 23:45 
GeneralRe: Sluggishness Pin
LittleYellowBird17-May-02 1:03
LittleYellowBird17-May-02 1:03 
GeneralRe: Sluggishness Pin
benjymous17-May-02 4:20
benjymous17-May-02 4:20 
GeneralRe: Sluggishness Pin
Mike Nordell17-May-02 0:06
Mike Nordell17-May-02 0:06 
GeneralRe: Sluggishness Pin
LittleYellowBird17-May-02 1:49
LittleYellowBird17-May-02 1:49 
GeneralRe: Sluggishness Pin
Mike Nordell21-May-02 5:39
Mike Nordell21-May-02 5:39 
General"Boost" Library and VC++ Pin
16-May-02 22:39
suss16-May-02 22:39 
GeneralRe: "Boost" Library and VC++ Pin
Aaron Schaefer17-May-02 6:46
Aaron Schaefer17-May-02 6:46 
GeneralBig Endian file format Pin
Philip Patrick16-May-02 22:38
professionalPhilip Patrick16-May-02 22:38 
GeneralRe: Big Endian file format Pin
David Chamberlain17-May-02 3:33
David Chamberlain17-May-02 3:33 
GeneralRe: Big Endian file format Pin
Philip Patrick17-May-02 4:05
professionalPhilip Patrick17-May-02 4:05 
GeneralRe: Big Endian file format Pin
David Chamberlain17-May-02 4:19
David Chamberlain17-May-02 4:19 
GeneralCosmetic interfaces' problem Pin
Hans Ruck16-May-02 22:02
Hans Ruck16-May-02 22:02 

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.