描述:
我是这样写的:
_CurDoc->GetProtectionType();
可编译的时候出现下列问题:
...\debug\msword9.tli(2897) : error C2556: 'enum WdProtectionType __thiscall Word::_Document::GetProtectionType(void)' : overloaded function differs only by return type from 'enum Word::WdProtectionType __thiscall Word::_D
ocument::GetProtectionType(void)'
...\debug\msword9.tlh(5894) : see declaration of 'GetProtectionType'
...\debug\msword9.tli(2897) : error C2371: 'GetProtectionType' : redefinition; different basic types
...\debug\msword9.tlh(5894) : see declaration of 'GetProtectionType'
Error executing cl.exe.
WordAddins.dll - 2 error(s), 0 warning(s)
我是通过import word.olb导入Word类型库的
请问高手这是什么问题?
解决方案1:
数字金刚是版主吗,怎么总见你回答大家的问题,好热心呀
解决方案2: if(m_WordDoc.GetProtectionType()==-1)
{
m_WordDoc.Protect(1,covFalse,COleVariant("DigitalTitan"));
}
m_WordDoc.Save();
m_WordApp.Quit(covFalse, // 保存修改
covTrue, // 原始格式
covFalse // RouteDocument.
);
m_WordDoc.ReleaseDispatch();
m_WordDocs.ReleaseDispatch();
m_WordApp.ReleaseDispatch();