错误C2065:"WCHAR":未声明的标识符 [英] error C2065: 'WCHAR' : undeclared identifier

查看:997
本文介绍了错误C2065:"WCHAR":未声明的标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了头文件

i created the header file

//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;
};



现在我创建了一个.cpp文件



now i created one .cpp file

class CReadSubstitute; //this is the forward declaration 

now i want to use the function 

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



但它给出了错误

错误C2065:"WCHAR":未声明的标识符
错误C2065:"szWord":未声明的标识符
错误C2448:``< unknown>'':函数样式的初始值设定项似乎是函数定义

有人可以分辨出什么是概率.
我还在.cpp



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

推荐答案

中包含了头文件,这取决于您的项目中包含了哪些系统头文件:要使用WCHAR,您应该包括windows.h
It depends on which system header files you have included in your project: to use WCHAR you should include tchar.h or windows.h


这篇关于错误C2065:"WCHAR":未声明的标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆