Hi There,
I am having problem when I compile a code which I create to test a
source file. The errors are :
error C2144: syntax error : 'void' should be preceded by ';'
error C2511: 'void CNewServiceApp: :function(SER,D WORD,LPVOID)' :
overloaded member function not found in 'CNewServiceApp '
Can someone help me to solve this?
Thanks,
Krish
HeaderFile
class CNewServiceApp : public CWinApp
{
public:
CNewServiceApp( );
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(C NewServiceApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//func(int);
//func(this);
static DWORD CALLBACK function(CServi ce*, DWORD, LPVOID);
DWORD function(CServi ce*, DWORD);
LPVOID arg;
//{{AFX_MSG(CNewS erviceApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE _MAP()
};
CPP file:
BOOL CNewServiceApp: :InitInstance()
{
AfxEnableContro lContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
arg = this;
MyService = new CService("NewSe rvice",function , this );
return FALSE;
}
typedef CService SER
void CNewServiceApp: :function(SER A, DWORD na, LPVOID arg)
{
CNewServiceApp *pCNewServiceAp p;
if (arg == NULL)
{
return FALSE;
}
pCNewServiceApp = (CNewServiceApp *)arg;
return pCNewServiceApp ->function(A, arg);
}
I am having problem when I compile a code which I create to test a
source file. The errors are :
error C2144: syntax error : 'void' should be preceded by ';'
error C2511: 'void CNewServiceApp: :function(SER,D WORD,LPVOID)' :
overloaded member function not found in 'CNewServiceApp '
Can someone help me to solve this?
Thanks,
Krish
HeaderFile
class CNewServiceApp : public CWinApp
{
public:
CNewServiceApp( );
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(C NewServiceApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//func(int);
//func(this);
static DWORD CALLBACK function(CServi ce*, DWORD, LPVOID);
DWORD function(CServi ce*, DWORD);
LPVOID arg;
//{{AFX_MSG(CNewS erviceApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE _MAP()
};
CPP file:
BOOL CNewServiceApp: :InitInstance()
{
AfxEnableContro lContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
arg = this;
MyService = new CService("NewSe rvice",function , this );
return FALSE;
}
typedef CService SER
void CNewServiceApp: :function(SER A, DWORD na, LPVOID arg)
{
CNewServiceApp *pCNewServiceAp p;
if (arg == NULL)
{
return FALSE;
}
pCNewServiceApp = (CNewServiceApp *)arg;
return pCNewServiceApp ->function(A, arg);
}
Comment