vc 2005中使用数字签名十分方便,只要包含了WinTrust.h、SoftPub.h和Mscat.h,并添加导入库WinTrust.lib;就可以直接调api,但使用VC6的朋友们就麻烦了,需要参考MSDN上的函数及结构体声明,自已定义函数指针最后进行调用。
因为项目用的是VC6,没办法,只好硬着头皮把函数指针扣出来,同时发现还有问题:
1.数字签名需要新sdk的支持,不装新的sdk,就算函数指针都对也无法正确编译
2.函数指针所在的文件,不能加预编译头,否则与mfc的一些定义会有冲突,需要在工程设置中选择这个文件,并设置他的"Precompiled Headers",设成"Not using procompiled headers",当然不要忘了在函数定义时加上extern "c",可以用define包起来.
vc 2005中的使用可参考:
http://www.titilima.cn/readblog.php?id=108