VS2015 ATL 在XP 系统下无法注册

1 篇文章 0 订阅
  1. Link the CRT statically - in Config Properties / C/C++ / Code Generation / Runtime Library select the non-DLL multi-threaded option, for example /MT in the release build.

  2. Add /Zc:threadSafeInit- (n.b. the trailing - is part of the switch) to the compiler options under Config Properties / C/C++ / Command Line / Additional Options.

Workaround #2 comes from the open case at https://connect.microsoft.com/VisualStudio/feedback/details/1907257.

Windows Server 2003 and Windows XP have problems with dynamically loading a DLL (via LoadLibrary) that uses thread-local storage, which is what thread-safe statics use internally to provide efficient execution when the static local has already been initialized. As these systems are out of support, it is extremely unlikely for a patch to be created for those systems to add this support as is present in Vista and newer OSes, and we are reluctant to penalize the performance on in-support OSes to provide this functionality to the old out-of-support ones.

To work around the issue you can use /Zc:threadSafeInit- to disable the thread-safe initialization code and this will avoid the thread-local variable. Of course by doing so the initialization code reverts back to the VS2013 mode and is not thread-safe, so this option is only viable if you don't rely on the thread-safety of local statics.

使用VS2015 ATL 制作的ACTIVEX控件在XP下无法注册。注册时提示 内存分配不成功。按上述两步更改重新生成后,可在XP内注册成功。




评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值