Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i created the header file

C++
//header file
class CReadSubstitute  
{
	protected:
	
		CReadSubstitute();
		virtual ~CReadSubstitute();
		void GetNextWord(WCHAR * szWord);
		void Substitute(WCHAR* szWord);
		void SetFont(LPSTR szFontName);
		void GetFont(LPSTR szFontName);

	private:
		xehandle m_xehndl;
		int32 m_start;
		int32 m_end;
		int32 m_textlen;
		int32 m_LoopCounter;
		int32 m_selWordStart,m_selWordEnd;
};


now i created one .cpp file

C++
class CReadSubstitute; //this is the forward declaration 

now i want to use the function 

CReadSubstitute::GetNextWord(WCHAR * szWord)
{
     //code 
}


but it is giving errors

error C2065: 'WCHAR' : undeclared identifier
error C2065: 'szWord' : undeclared identifier
error C2448: '<unknown>' : function-style initializer appears to be a function definition

can some1 tell what is the prob.
i also included the header file in .cpp
Posted
Updated 13-Jul-10 20:53pm
v7

1 solution

It depends on which system header files you have included in your project: to use WCHAR you should include tchar.h or windows.h
 
Share this answer
 
Comments
scarecrow777 14-Jul-10 2:59am    
thanks it worked for me
sixianxi 18-Jun-13 3:58am    
how about "tchar"?
Sauro Viti 18-Jun-13 4:21am    
TCHAR is always the best choice as it make your application Unicode-aware.
It is just a typedef that translate to char when _UNICODE is not defined and to WCHAR otherwise.
To use the TCHAR datatype you should include the tchar.h header.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900