进程外 COM 服务器执行 [英] Out of process COM server execution

查看:15
本文介绍了进程外 COM 服务器执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将一个古老但仍然有用的 Delphi 5 应用程序变成了一个进程外 COM 服务器.我隐约记得有一种方法可以判断它是由用户直接启动还是作为服务器启动.我知道我以前做过,但我不记得/不知道怎么做.也许是命令行开关?

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?

推荐答案

不知道在Delphi 5中是否有这个功能,但是在Delphi 2010中可以查询全局ComServer对象的启动模式:

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');

这篇关于进程外 COM 服务器执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆