为什么静态链接MFC库后AfxLoadLibrary变成未定义的了?
为什么工程在静态链接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




