gpt4 book ai didi

delphi - 如何检查 OleInitialize 是否已被调用?

转载 作者:行者123 更新时间:2023-12-03 15:45:50 28 4
gpt4 key购买 nike

我想写一个Delphi函数来注册一个dll。我希望该函数在执行此操作之前检查是否已调用 OleInitialize。我想我正在努力避免初始化两次的后果,因为我不确定它们可能是什么。我担心我的函数无法像 regsvr32.exe 那样处理广泛的 dll。

最佳答案

看看documentation :

Return Value
[...]
S_FALSE - The COM library is already initialized on this apartment.

...还有:

Typically, the COM library is initialized on an apartment only once. Subsequent calls will succeed, as long as they do not attempt to change the concurrency model of the apartment, but will return S_FALSE.

关于delphi - 如何检查 OleInitialize 是否已被调用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3278273/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com