其他语言

本类阅读TOP10

·基于Solaris 开发环境的整体构思
·使用AutoMake轻松生成Makefile
·BCB数据库图像保存技术
·GNU中的Makefile
·射频芯片nRF401天线设计的分析
·iframe 的自适应高度
·BCB之Socket通信
·软件企业如何实施CMM
·入门系列--OpenGL最简单的入门
·WIN95中日志钩子(JournalRecord Hook)的使用

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
关于测试一个windows动态链接库的问题;请教各位大侠!

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

有如下程序:

// test1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>

int main(int argc, char* argv[])
{
 printf("Hello World!\n");

 typedef int(*pSleep)(long sleepTime);
    HINSTANCE hDLL;
    pSleep psleep;

 HDLL=LoadLibrary("D:\\广东省建设银行\\Sleep\\sleep\\Debug\\sleep.dll");//加载动态链接库sleep.dll文件;
    psleep=(pSleep)GetProcAddress(hDLL,"sleep");
   
 for (int i=0;i<3;i++){
        printf("Sleeping for %d seconds\n", i);
  psleep(300);
 }
 FreeLibrary(hDLL);//卸载MyDll.dll文件;

 return 0;
}

编译是为何报这个错:

D:\广东省建设银行\Sleep\test1\test1.cpp(15) : error C2440: '=' : cannot convert from 'struct HINSTANCE__ *' to 'int'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.

test1.obj - 2 error(s), 0 warning(s)




相关文章

相关软件