//调用前,需讲dll文件放在项目文件中 #include #include int main( int argc, char *argv[] ) {
#include
#include
int main( int argc, char *argv[] )
{
HINSTANCE hdll = NULL;
hdll = LoadLibrary ( "Mwic_32.dll" );
//通过类型定义语句typedef来定义函数指针类型
typedef BOOL ( _stdcall *lpFileEncrypt )( INT, INT);
//函数声明
lpFileEncrypt FileEncrypt1;
//获取函数File Encrypt的函数指针
FileEncrypt1 = ( lpFileEncrypt )::GetProcAddress( hdll, "auto_init" );
//调用DLL中函数auto_init
int a = FileEncrypt1(0,38400);
//释放DLL模块
FreeLibrary( hdll );
char * aa;
printf( "Result= %d\n", a);
system("PAUSE");
}
阅读(9349) | 评论(1) | 转发(0) |