[ARX]关于安全密码编程实现的问题
<FONT face=宋体 size=2>我想通过程序为当前图形数据库设置安全密码,代码如下:<BR>wchar_t *pwdBuf = pwd.AllocSysString();<BR>CString csProvName = "Microsoft Base Cryptograghic Provider v1.0";<BR>wchar_t *provName = csProvName.AllocSysString();<BR><BR>AcDbDatabase *pDb = acdbHostApplicationServices()->workingDatabase();<BR>SecurityParams *secParams = new SecurityParams();<BR>secParams->cbSize = 48;<BR>secParams->ulFlags = 1;<BR>secParams->ulProvType = 1;<BR>secParams->ulAlgId = 26625;<BR>secParams->ulKeyLength = 40;<BR>secParams->wszPassword = pwdBuf;<BR>secParams->wszProvName = provName;<BR><BR>bool ret = pDb->setSecurityParams( secParams );<BR><BR>delete secParams;<BR><BR>但每次setSecurityParams返回的总是false,不知道错在哪里?<BR>然后当我打开一个已加密的DWG文件,使用<BR>const SecurityParams *secParams = pDb->cloneSecurityParams();<BR>bool ret = pDb->setSecurityParams( secParams );<BR>返回的就是true,我仔细对比了一下两个SecurityParams的值,觉得并没有什么差异啊。为什么结果会不一样,盼高手能够解答?<BR>谢谢!</FONT>
页:
[1]