查看你的 rgs 文件,并且做如下替换:
ForceRemove {9ACB97C6-4492-40E8-A1BD-51DFE8962E92} = s ‘CMyObject Class’
{
ProgID = s 'ATLComService.CMyObject.1'
VersionIndependentProgID = s 'ATLComService.CMyObject'
ForceRemove 'Programmable'
LocalServer32 = s '%MODULE%'
'TypeLib' = s '{E423A7DE-58C7-4535-A864-395DCEDE941F}'
}
替换成:
ForceRemove {9ACB97C6-4492-40E8-A1BD-51DFE8962E92} = s 'CMyObject Class'
{
ProgID = s 'ATLComService.CMyObject.1'
VersionIndependentProgID = s 'ATLComService.CMyObject'
ForceRemove 'Programmable'
LocalServer32 = s '%MODULE%'
val AppID = s '%APPID%'
'TypeLib' = s '{E423A7DE-58C7-4535-A864-395DCEDE941F}'
}
!!!重要!!!加上这个val AppID = s ‘%APPID%’
加上预处理器定义_ATL_FREE_THREADED