K
Krish
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,DWORD,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(CNewServiceApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//func(int);
//func(this);
static DWORD CALLBACK function(CService*, DWORD, LPVOID);
DWORD function(CService*, DWORD);
LPVOID arg;
//{{AFX_MSG(CNewServiceApp)
// 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()
{
AfxEnableControlContainer();
// 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("NewService",function, this );
return FALSE;
}
typedef CService SER
void CNewServiceApp::function(SER A, DWORD na, LPVOID arg)
{
CNewServiceApp *pCNewServiceApp;
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,DWORD,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(CNewServiceApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//func(int);
//func(this);
static DWORD CALLBACK function(CService*, DWORD, LPVOID);
DWORD function(CService*, DWORD);
LPVOID arg;
//{{AFX_MSG(CNewServiceApp)
// 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()
{
AfxEnableControlContainer();
// 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("NewService",function, this );
return FALSE;
}
typedef CService SER
void CNewServiceApp::function(SER A, DWORD na, LPVOID arg)
{
CNewServiceApp *pCNewServiceApp;
if (arg == NULL)
{
return FALSE;
}
pCNewServiceApp = (CNewServiceApp*)arg;
return pCNewServiceApp ->function(A, arg);
}