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

查看:126
本文介绍了进程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天全站免登陆