Out of process COM server execution

ⅰ亾dé卋堺 提交于 2019-12-19 02:52:08

问题


I've turned an ancient, but still useful, Delphi 5 application into an out of process COM server. I vaguely recall that there's a way to tell if it's started directly by a user or as the server. I know I've done it before, but I can't remember/find how to do it. A command line switch, maybe?


回答1:


I do not know whether this was available in Delphi 5, but in Delphi 2010 you can query the global ComServer object for the start mode:

if ComServer.StartMode = smAutomation then
  ShowMessage('started as automation server')
else if ComServer.StartMode = smStandalone then
  ShowMessage('started manually');



回答2:


It seems that the exe is started with the switch "-Embedding" when started as a COM server.



来源:https://stackoverflow.com/questions/12397514/out-of-process-com-server-execution

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!