在编译的过程中,会报ItemType和CustomType未定义的问题。
代码如下
头文件包含如下
mke文件如图所示
希望老师能够帮忙解答!
因为构造函数在头文件中没有给出定义,所以您不能声明其实例去使用,只能通过指针或者引用来使用
Answer Verified By: xz h
感谢郭老师
郭老师,现在又遇到了一个问题,在创建的时候,先创建ItemTypeLibrary,一直创建的结构都为空。
DgnFileP dgnFileP = ISessionMgr::GetActiveDgnFile(); DgnFileR dgnFile = *dgnFileP; WString itemLibraryName = L"GongCheng"; WString itemTypeName = L"ShuXing"; ItemTypeLibraryPtr itemTypeLibraryPtr=NULL; itemTypeLibraryPtr->FindByName(itemLibraryName.GetWCharCP(), *dgnFileP); //itemTypeLibraryPtr = ItemTypeLibrary::FindByName(itemLibraryName.GetWCharCP(), *dgnFileP); if (NULL==itemTypeLibraryPtr.IsNull()) { itemTypeLibraryPtr->Create(itemLibraryName.GetWCharCP(), dgnFile, true); //itemTypeLibraryPtr=ItemTypeLibrary::Create(itemLibraryName.GetWCharCP(), dgnFile); } ItemTypeLibrary& itemTypeLibrary = *itemTypeLibraryPtr.get();
itemTypeLibraryPtr.IsNull()返回的值是true(非0)或false(0),您可以调试一下程序看看是否执行您的Create这一步了,碰到问题得学会利用VS的调试功能
谢谢郭老师,是我太粗心了,解决了