/**
* Class representing xxx.
*
* <br><b>Role</b>: Provide the basic class function...
* <p>
* It implements the interfaces :
* <ol>
* <li>@href CATIPrtWksAddin
* </ol>
*
* @href ClassReference, Class#MethodReference, #InternalMethod...
*/
class MyNewAddin3: public CATBaseUnknown
//class MyNewAddin3: public CATIWorkbenchAddin
{
CATDeclareClass;
public:
// Standard constructors and destructors for an implementation class
// -----------------------------------------------------------------
MyNewAddin3 ();
virtual ~MyNewAddin3 ();
private:
// The copy constructor and the equal operator must not be implemented
// -------------------------------------------------------------------
MyNewAddin3 (MyNewAddin3 &);
MyNewAddin3& operator=(MyNewAddin3&);
// Link the implementation to its interface
// ---------------------------------------
void MyNewAddin3::CreateCommands()
{
new PartCmdHeader("point","CmdModule","TestCmd",(void *)NULL);
new PartCmdHeader("line","CmdModule","LinCmd",(void *)NULL);
}
//TIE or TIEchain definitions
#include "TIE_CATIPrtWksAddin.h"
TIE_CATIPrtWksAddin(MyNewAddin3);
//Methods implementation
Imakefile.mk 文件内容如下:
# COPYRIGHT Dassault Systemes 2010
#======================================================================
# Imakefile for module MyFirstModule.m
#======================================================================
#
# Mar 2010 Creation: Code generated by the CAA wizard Administrator
#======================================================================
#
# SHARED LIBRARY
#
BUILT_OBJECT_TYPE=SHARED LIBRARY
# DO NOT EDIT :: THE CAA2 WIZARDS WILL ADD CODE HERE
WIZARD_LINK_MODULES = JS0GROUP \
JS0FM JS0GROUP CATMechanicalModelerUI MechanicalModelerUIUUID \
PrtWorkshop
# END WIZARD EDITION ZONE
LINK_WITH = $(WIZARD_LINK_MODULES)
# System dependant variables
#
OS = AIX
#
OS = HP-UX
#
OS = IRIX
#
OS = SunOS
#
OS = Windows_NT
错误信息如下
------ Rebuild All started: Project: MyFirstModule.m, Configuration: Debug Win32 ------
Deleting intermediate and output files for project 'MyFirstModule.m', configuration 'Debug|Win32'
Compiling...
MyNewAddin3.cpp
Linking...
MyNewAddin3.obj : error LNK2019: unresolved external symbol "public: static class CATMetaClass * __cdecl CATCommandHeader::MetaObject(void)" (?MetaObject@CATCommandHeader@@SAPAVCATMetaClass@@XZ) referenced in function "public: static class CATMetaClass * __cdecl PartCmdHeader::MetaObject(void)" (?MetaObject@PartCmdHeader@@SAPAVCATMetaClass@@XZ)
MyNewAddin3.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall CATBaseUnknown:ueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CATBaseUnknown@@UAEJABU_GUID@@PAPAX@Z)
MyNewAddin3.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __thiscall CATBaseUnknown::AddRef(void)" (?AddRef@CATBaseUnknown@@UAEKXZ)
MyNewAddin3.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __thiscall CATBaseUnknown::Release(void)" (?Release@CATBaseUnknown@@UAEKXZ)
MyNewAddin3.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall CATBaseUnknown::GetTypeInfoCount(unsigned int *)" (?GetTypeInfoCount@CATBaseUnknown@@UAEJPAI@Z)
MyNewAddin3.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall CATBaseUnknown::GetTypeInfo(unsigned int,unsigned long,struct ITypeInfo * *)" (?GetTypeInfo@CATBaseUnknown@@UAEJIKPAPAUITypeInfo@@@Z)
MyNewAddin3.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall CATBaseUnknown::GetIDsOfNames(struct _GUID const &,wchar_t * *,unsigned int,unsigned long,long *)" (?GetIDsOfNames@CATBaseUnknown@@UAEJABU_GUID@@PAPA_WIKPAJ@Z)
MyNewAddin3.obj : error LNK2001: unresolved external symbol "public: virtual long __thiscall CATBaseUnknown::Invoke(long,struct _GUID const &,unsigned long,unsigned short,struct tagDISPPARAMS *,struct tagVARIANT *,struct tagEXCEPINFO *,unsigned int *)" (?Invoke@CATBaseUnknown@@UAEJJABU_GUID@@KGPAUtagDISPPARAMS@@PAUtagVARIANT@@PAUtagEXCEPINFO@@PAI@Z)
MyNewAddin3.obj : error LNK2001: unresolved external symbol "public: virtual class CATBaseUnknown * __thiscall CATBaseUnknown::GetImpl(int)const " (?GetImpl@CATBaseUnknown@@UBEPAV1@H@Z)
MyNewAddin3.obj : error LNK2001: unresolved external symbol "public: virtual class CATBaseUnknown * __thiscall CATBaseUnknown::SetImpl(class CATBaseUnknown *)" (?SetImpl@CATBaseUnknown@@UAEPAV1@PAV1@@Z)
MyNewAddin3.obj : error LNK2019: unresolved external symbol "public: static class CATMetaClass * __cdecl CATBaseUnknown::MetaObject(void)" (?MetaObject@CATBaseUnknown@@SAPAVCATMetaClass@@XZ) referenced in function "public: static class CATMetaClass * __cdecl MyNewAddin3::MetaObject(void)" (?MetaObject@MyNewAddin3@@SAPAVCATMetaClass@@XZ)
MyNewAddin3.obj : error LNK2019: unresolved external symbol "struct _GUID IID_CATIPrtWksAddin" (?IID_CATIPrtWksAddin@@3U_GUID@@A) referenced in function "public: static class CATMetaClass * __cdecl TIECATIPrtWksAddinMyNewAddin3::MetaObject(void)" (?MetaObject@TIECATIPrtWksAddinMyNewAddin3@@SAPAVCATMetaClass@@XZ)
MyNewAddin3.obj : error LNK2019: unresolved external symbol "public: static class CATMetaClass * __cdecl CATIPrtWksAddin::MetaObject(void)" (?MetaObject@CATIPrtWksAddin@@SAPAVCATMetaClass@@XZ) referenced in function "public: static class CATMetaClass * __cdecl TIECATIPrtWksAddinMyNewAddin3::MetaObject(void)" (?MetaObject@TIECATIPrtWksAddinMyNewAddin3@@SAPAVCATMetaClass@@XZ)
MyNewAddin3.obj : error LNK2001: unresolved external symbol "public: virtual class CATMetaClass * __thiscall CATBaseUnknown::GetMetaObject(void)const " (?GetMetaObject@CATBaseUnknown@@UBEPAVCATMetaClass@@XZ)
MyNewAddin3.obj : error LNK2019: unresolved external symbol "long __cdecl Tie_GetIDsOfNames(struct IDispatch *,class CATMetaClass *,struct _GUID const &,wchar_t * *,unsigned int,unsigned long,long *)" (?Tie_GetIDsOfNames@@YAJPAUIDispatch@@PAVCATMetaClass@@ABU_GUID@@PAPA_WIKPAJ@Z) referenced in function "public: virtual long __thiscall TIECATIPrtWksAddinMyNewAddin3::GetIDsOfNames(struct _GUID const &,wchar_t * *,unsigned int,unsigned long,long *)" (?GetIDsOfNames@TIECATIPrtWksAddinMyNewAddin3@@UAEJABU_GUID@@PAPA_WIKPAJ@Z)
..\..\..\intel_a\code\bin\MyFirstModule.dll : fatal error LNK1120: 15 unresolved externals
Build log was saved at "file://c:\MyFirstWorkspace\ToolsData\VisualStudio2005\MyFirstFramework\Debug\BuildLog.htm"
MyFirstModule.m - 16 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========