error C2065: 'hdll' : undeclared identifier
泡芙女孩儿 2012-10-22 11:19:37 刚刚编写了一个动态链接库的实例,却出现这样的错误,求高手指教。
#include "stdafx.h"
#include "a.h"
#include "aDlg.h"
__________________________________________________
___________________________________________________
void CADlg::OnButton1()
{
// TODO: Add your control notification handler code here
hdll=loadLibrary("text.dll");
if(hdll)
{
typedef void(*PROCTYPE);
PROCTYPE myprint=(PROCTYPE)GetProcAddress(hdll,"print");//得到函数地址
(*myprint)();
}
FreeLibrary(hdll);//释放库
}
_______________________________________________________________
_________________________
--------------------Configuration: a - Win32 Debug--------------------
Compiling...
aDlg.cpp
C:\Documents and Settings\Administrator\桌面\text\a\aDlg.cpp(177) : error C2065: 'hdll' : undeclared identifier
C:\Documents and Settings\Administrator\桌面\text\a\aDlg.cpp(177) : error C2065: 'loadLibrary' : undeclared identifier
C:\Documents and Settings\Administrator\桌面\text\a\aDlg.cpp(182) : error C2100: illegal indirection
C:\Documents and Settings\Administrator\桌面\text\a\aDlg.cpp(182) : error C2064: term does not evaluate to a function
Error executing cl.exe.
aDlg.obj - 4 error(s), 0 warning(s)
若是添加链接库的头文件#include "text.h"会出现这样的错误,求教哪位大侠能帮忙分析一下,给出正解。
#include "stdafx.h"
#include "a.h"
#include "aDlg.h"
#include "text.h"
———————————————————————————————
______________________________________________
--------------------Configuration: a - Win32 Debug--------------------
Compiling...
aDlg.cpp
C:\Documents and Settings\Administrator\桌面\text\a\aDlg.cpp(7) : fatal error C1083: Cannot open include file: 'text.h': No such file or directory
Error executing cl.exe.
a.exe - 1 error(s), 0 warning(s)