CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  进程/线程/DLL

为什么静态链接MFC库后AfxLoadLibrary变成未定义的了?

楼主SBDCW(观雨)2005-06-02 13:46:48 在 VC/MFC / 进程/线程/DLL 提问

为什么工程在静态链接MFC库后AfxLoadLibrary变成未定义的了?而动态链接MFC库则没有问题。动态链接接MFC库和静态链接在代码上的区别有哪些?谢谢各位了!! 问题点数:50、回复次数:3Top

1 楼dongfa(一桶江湖( http://www.codelive.net ))回复于 2005-06-02 15:32:08 得分 17

使用LoadLibrary不就可以了吗?  
   
  mfc源程序  
   
  //   special   functions   for   loading   and   freeing   MFC   extension   DLLs  
  //   (necessary   if   your   app   is   multithreaded   and   loads   extension  
  //     DLLs   dynamically)  
  HINSTANCE   AFXAPI   AfxLoadLibrary(LPCTSTR   lpszModuleName);  
  BOOL   AFXAPI   AfxFreeLibrary(HINSTANCE   hInstLib);  
  Top

2 楼DentistryDoctor(不在无聊中无奈,就在沉默中变态)回复于 2005-06-02 17:08:36 得分 17

AfxLoadLibrary定义在afxdll_.h中,同时你看看Afxdll_;h  
   
  //   This   is   a   part   of   the   Microsoft   Foundation   Classes   C++   library.  
  //   Copyright   (C)   Microsoft   Corporation  
  //   All   rights   reserved.  
  //  
  //   This   source   code   is   only   intended   as   a   supplement   to   the  
  //   Microsoft   Foundation   Classes   Reference   and   related  
  //   electronic   documentation   provided   with   the   library.  
  //   See   these   sources   for   detailed   information   regarding   the  
  //   Microsoft   Foundation   Classes   product.  
   
  //   afxdll_.h   -   extensions   to   AFXWIN.H   used   for   the   'AFXDLL'   version  
  //   This   file   contains   MFC   library   implementation   details   as   well  
  //       as   APIs   for   writing   MFC   Extension   DLLs.  
  //   Please   refer   to   Technical   Note   033   (TN033)   for   more   details.  
   
  /////////////////////////////////////////////////////////////////////////////  
   
  #ifndef   _AFXDLL  
  #error   file   must   be   compiled   with   _AFXDLL  
  #endif  
   
   
  说明如果是在静态库中使用MFC,根本就不会包含此文件,同时也根本不能包含此文件,所以。。。Top

3 楼xwzxwz(怪物)回复于 2005-06-02 17:32:38 得分 16

你用win32sdk的LoadLibrary和FreeLibrary代替不就行了么.....  
   
  参数和返回值都一样的Top

相关问题

  • 编译时VC6居然提示基类"CListView"未定义?MFC的基类啊,怎么会未定义?
  • GraphicsUnit未定义???
  • B800H未定义?
  • 'aa'未定义!!!
  • 变量未定义?
  • 变量未定义:
  • 线程未定义?
  • 在MFC中使用win32的loadcursor报错说loadcursor未定义。不知何解?只攒了30分。谢谢啦。
  • [求助]错误 未定义
  • 未定义类型“ADOConnection”。

关键词

  • mfc
  • microsoft
  • afxloadlibrary
  • 静态
  • afxdll
  • 库
  • 链接
  • extension
  • microsoft foundation
  • library

得分解答快速导航

  • 帖主:SBDCW
  • dongfa
  • DentistryDoctor
  • xwzxwz

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo