关于静态函数调用问题

来源:百度知道 编辑:UC知道 时间:2024/05/05 11:45:16
public:
static int InternetGetFile (HWND hWnd,CString szUrl,CString szFileName);
static UINT DownProc(LPVOID pDownInfo);
void AddLog(CString sLog);

有这样3个函数,我想在2个static函数中调用AddLog,但编译的时候提示"F:\Lunacave Express Print\Updata\UpdataDlg.cpp(216) : error C2352: 'CUpdataDlg::AddLog' : illegal call of non-static member function
f:\lunacave express print\updata\updatadlg.h(48) : see declaration of 'AddLog'"

用什么办法调用呢?新手,问题难免会让你肚子疼,但还请知道的回答下.

不允许在类的静态函数里面访问非静态成员变量或者非静态函数的;;因为这样的操作是缺少对象,编译器不知道你这个操作影响的是哪一个类的实例

http://www.moon-soft.com/doc/18639.htm

希望这个对你有帮助