Hi,

I tried the following snippet of code

BEGIN_MESSAGE_MAP(CSpeechDlg, CDialog)
	//{{AFX_MSG_MAP(CSpeechDlg)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_BN_CLICKED(IDC_BUTTON_VOICE_TRAINING, OnButtonVoiceTraining)
	ON_BN_CLICKED(IDC_BUTTON_MICRO_SETUP, OnButtonMicroSetup)
	ON_BN_CLICKED(IDC_BUTTON_SPEAK, OnButtonSpeak)
	ON_BN_CLICKED(IDC_BUTTON_ABOUT, OnButtonAbout)
	//}}AFX_MSG_MAP
	ON_MESSAGE(WM_RECOEVENT,OnRecoEvent)
END_MESSAGE_MAP()

but i got an error at this line:

ON_MESSAGE(WM_RECOEVENT,OnRecoEvent)

the error is :

Error	1	error C2440: 'static_cast' : cannot convert from 'void (__thiscall CSpeechDlg::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'

here's the definitions for the passing parameters:

#define WM_RECOEVENT    WM_USER+5

OnRecoEvent is a void function...

You haven't shown the signature for OnRecoEvent(), but it should be like this:-
Declare the function in CSpeechDlg as:
afx_msg LRESULT OnRecoEvent(WPARAM wp, LPARAM lp);

and define it as:
LRESULT CSpeechDlg::OnRecoEvent(WPARAM wp, LPARAM lp)
{
return 0; // or 1
}

well the building error is solved but i got a run time error!!!

here's the error:

Runtime Error!

R6034
An application has made an attempt to load C runtime library incorrectly.

well the building error is solved but i got a run time error!!!

here's the error:

Runtime Error!

R6034
An application has made an attempt to load C runtime library incorrectly.

Check out this error in MSDN R6034

I set the generation of the mainfest file property to yes but i got the same error!!!
check this

This article has been dead for over six months. Start a new discussion instead.