Click here to Skip to main content
15,913,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to send a msg between MainFrame and a view? Pin
Software20075-Jan-10 10:02
Software20075-Jan-10 10:02 
GeneralRe: How to send a msg between MainFrame and a view? Pin
Richard MacCutchan5-Jan-10 10:50
mveRichard MacCutchan5-Jan-10 10:50 
GeneralRe: How to send a msg between MainFrame and a view? Pin
Software20076-Jan-10 2:30
Software20076-Jan-10 2:30 
GeneralRe: How to send a msg between MainFrame and a view? Pin
Richard MacCutchan6-Jan-10 3:48
mveRichard MacCutchan6-Jan-10 3:48 
QuestionRe-drawing Transparent Bitmap - Strange Behavior Pin
softwaremonkey5-Jan-10 5:05
softwaremonkey5-Jan-10 5:05 
AnswerRe: Re-drawing Transparent Bitmap - Strange Behavior Pin
Cedric Moonen5-Jan-10 8:28
Cedric Moonen5-Jan-10 8:28 
GeneralRe: Re-drawing Transparent Bitmap - Strange Behavior Pin
softwaremonkey5-Jan-10 8:42
softwaremonkey5-Jan-10 8:42 
GeneralRe: Re-drawing Transparent Bitmap - Strange Behavior Pin
Cedric Moonen5-Jan-10 9:14
Cedric Moonen5-Jan-10 9:14 
GeneralRe: Re-drawing Transparent Bitmap - Strange Behavior Pin
softwaremonkey5-Jan-10 9:31
softwaremonkey5-Jan-10 9:31 
GeneralRe: Re-drawing Transparent Bitmap - Strange Behavior Pin
Rozis6-Jan-10 10:15
Rozis6-Jan-10 10:15 
GeneralRe: Re-drawing Transparent Bitmap - Strange Behavior Pin
softwaremonkey6-Jan-10 11:39
softwaremonkey6-Jan-10 11:39 
QuestionEditCtrl Pin
kumar sanghvi5-Jan-10 2:27
kumar sanghvi5-Jan-10 2:27 
AnswerRe: EditCtrl Pin
CPallini5-Jan-10 2:42
mveCPallini5-Jan-10 2:42 
Questionhow to get a hidden file extensions? Pin
nenfa5-Jan-10 1:33
nenfa5-Jan-10 1:33 
QuestionRe: how to get a hidden file extensions? Pin
CPallini5-Jan-10 2:26
mveCPallini5-Jan-10 2:26 
AnswerRe: how to get a hidden file extensions? Pin
Hamid_RT5-Jan-10 3:35
Hamid_RT5-Jan-10 3:35 
AnswerRe: how to get a hidden file extensions? Pin
Steve Mayfield5-Jan-10 9:53
Steve Mayfield5-Jan-10 9:53 
QuestionHooking Pin
S p k 5215-Jan-10 0:50
S p k 5215-Jan-10 0:50 
Questionc++ Pin
surekha.btech5-Jan-10 0:15
surekha.btech5-Jan-10 0:15 
AnswerRe: c++ Pin
«_Superman_»5-Jan-10 0:28
professional«_Superman_»5-Jan-10 0:28 
AnswerRe: c++ Pin
CPallini5-Jan-10 0:28
mveCPallini5-Jan-10 0:28 
AnswerRe: c++ Pin
bilal haider5-Jan-10 0:56
bilal haider5-Jan-10 0:56 
AnswerRe: c++ Pin
Richard MacCutchan5-Jan-10 1:15
mveRichard MacCutchan5-Jan-10 1:15 
AnswerRe: c++ Pin
Hamid_RT5-Jan-10 3:17
Hamid_RT5-Jan-10 3:17 
QuestionDerived Class Function Pointer Error Pin
J Forde5-Jan-10 0:11
professionalJ Forde5-Jan-10 0:11 
Hi
I'm getting the following error during compilation:

error C2440: '=' : cannot convert from 'void (__thiscall CCBEMFGUILayer::*)(const char *)' to 'void (__thiscall CCBEMFLayer::*)(const char *)'

on the line: pMFPostMessage = MFPostMessage; // see below

CCBEMFGUILayer::CCBEMFGUILayer()
{
sLayerSignature = "<SourceLayer Name=\"GUI\"";
pMFPostMessage = MFPostMessage;
}

CCBEMFGUILayer::~CCBEMFGUILayer()
{

}

string CCBEMFGUILayer::GetLayerSignature()
{
return sLayerSignature;
}

void CCBEMFGUILayer::MFPostMessage( const char *cGUIMessage )
{

string sRecvMessage;

sRecvMessage = (string)cGUIMessage;

return;
}


MFGUILayer inherits from MFLayer.

class CCBEMFLayer
{
public:
CCBEMFLayer();
virtual ~CCBEMFLayer();
virtual void MFPostMessage( const char * );
virtual string GetLayerSignature();
void (CCBEMFLayer::*pMFPostMessage)( const char * );

};

class CCBEMFGUILayer : public CCBEMFLayer
{
public:
CCBEMFGUILayer();
virtual ~CCBEMFGUILayer();
string GetLayerSignature();
void MFPostMessage( const char * );

protected:
string sLayerSignature;
};


MFGUILayer implements MFPostMessage and I want to store a pointer to this function so I can add it to a subscriber class and then call the appropriate function based on a message signature.

How do I cast this correctly (if at all)?

Any help or direction appreciated.

Jim

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.