ShellExecuteEx和在VCL线程中共初始化 [英] ShellExecuteEx and Coinitialize in VCL thread
本文介绍了ShellExecuteEx和在VCL线程中共初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在使用中的main/VCL线程中调用Coinitialize
/en-us/library/windows/desktop/bb762154.aspx rel = nofollow> ShellExecuteEx
?
Do I need to call Coinitialize
in the main/VCL thread in Delphi
before using ShellExecuteEx
?
对于线程,是的,但对于VCL线程?
For a thread, yes but for the VCL thread ?
推荐答案
无需调用 CoInitialize
用于Windows窗体应用程序。
这是在主线程中为您完成的。
更具体的 TApplication.Create
在 Forms.Pas
中:
No need to call CoInitialize
for Windows Forms Applications.
This is done for you in the main thread.
More specific TApplication.Create
in Forms.Pas
:
...
if not IsLibrary then
FNeedToUninitialize := Succeeded(OleInitialize(nil));
...
这篇关于ShellExecuteEx和在VCL线程中共初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文