我下载了别人写的一个WIN32 CONSOLE程序,他把好多方法都封装在DLL文件里
我想在我的WIN32MFC项目里应用他DLL中的方法,于是把他定义接口的头文件,和DLL都拷贝到了我的应用下,编译通过,但是进行联接是出错:
error LNK2001: unresolved external symbol _IID_IHEventSink
error LNK2001: unresolved external symbol _IID_IHInput我想应该是我写的应用没有找到他所用的DLL的原因吧,不知道该如何解决
(他只有DLL,没有LIB)
我想在我的WIN32MFC项目里应用他DLL中的方法,于是把他定义接口的头文件,和DLL都拷贝到了我的应用下,编译通过,但是进行联接是出错:
error LNK2001: unresolved external symbol _IID_IHEventSink
error LNK2001: unresolved external symbol _IID_IHInput我想应该是我写的应用没有找到他所用的DLL的原因吧,不知道该如何解决
(他只有DLL,没有LIB)
LoadLibrary,GetProcAddress,FreeLibrary
IID_IHInput?如laiyiling所说,它给你的可以是个COM组件。如果是COM组件,可以考虑COM的方法。
DECLARE_INTERFACE_(IHXTLogObserver, IUnknown)
{
/*
* IUnknown methods
*/
STDMETHOD(QueryInterface) (THIS_
REFIID riid,
void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; /************************************************************************
* Method:
* IHXTLogObserverManager::OnEndService
* Purpose:
* The observer will receive this call as notification that the log system
* is shutting down, and that all log messages have been delivered.
* Parameters:
* NONE
* Returns:
* Ignored.
*/
STDMETHOD(OnEndService) (THIS) PURE; /************************************************************************
* Method:
* IHXTLogObserverManager::ReceiveMsg
* Purpose:
* Method called on an observer when a log message is sent to the log
* system that passes the observers filter.
* Parameters:
* szNamespace - [in] The namespace used to qualify the functional area
* and translated messge.
* nCode - [in] The important level of the message.
* unFuncArea - [in] numeric value used in the message as the functional area
* szFuncArea - [in] The translated string for the numeric functional area, if
* one was found.
* nTimeStamp - [in] The time (in milliseconds since midnight, Jan.1, 1970) at
* which the log message was sent to the log system.
* nMsg - [in] The numeric value used to identify the message for translation.
* szMsg - [in] The actual message text, either translation or the text sent
* to the LogMessage method.
* szJobName - [in] The name of the job from which the message originated.
* Returns:
* Ignored.
*/
STDMETHOD(ReceiveMsg) (THIS_
const char* /*IN*/ szNamespace,
EHXTLogCode /*IN*/ nCode,
UINT32 /*IN*/ unFuncArea,
const char* /*IN*/ szFuncArea,
INT32 /*IN*/ nTimeStamp,
UINT32 /*IN*/ nMsg,
const char* /*IN*/ szMsg,
const char* /*IN*/ szJobName) PURE;
};
#include "../****.h"//这里请注意路径
#include "../****_i.c"//这里请注意路径你可以看看
http://www.vckbase.com/document/viewdoc/?id=915
http://www.vckbase.com/document/viewdoc/?id=916
#include "../****.h"//这里请注意路径
#include "../****_i.c"//这里请注意路径你可以看看
http://www.vckbase.com/document/viewdoc/?id=915
http://www.vckbase.com/document/viewdoc/?id=916