如何在DELPHI中编写也是COM服务器的EXE [英] How to write an EXE which is also a COM Server in Delphi

查看:206
本文介绍了如何在DELPHI中编写也是COM服务器的EXE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Delphi(2007)应用程序,它只是一个标准exe,我想为其添加一个COM接口.我已经有一个COM dll,可以导出几个COM对象,并且运行良好.但是,当我尝试将DLL中的COM逻辑(即"exports"和"{$ R * .TLB}"及其相关用途)插入EXE的dpr文件时,它们都可以完美编译,但是在我调用regsvr32时拒绝注册myname.exe

I have a Delphi (2007) application which is just a standard exe, and I would like to add a COM interface to it. I already have a COM dll which exports several COM objects and this is working perfectly. However when I attempted to insert the COM logic from the dll (ie the "exports" and "{$R *.TLB}" and the relevant uses) into the EXE's dpr file it all compiles perfectly but refuses to register when I call regsvr32 myname.exe

我还尝试创建一个全新的VCLForms应用程序,并通过IDE向导向其中添加了AutomationObject,但是Delphi似乎不希望我这样做,因为没有可用的Activex组件.

I also tried creating an completely new VCLForms application and adding a AutomationObject to it via the IDE wizards but Delphi does not seem to want me to do that as no activex components are available.

是否有可能做我尝试做的事情?如果是这样,有人对可能出什么问题有任何想法吗?

Is it even possible to do what I attempting? If so, does anyone have any idea on what might be going wrong?

谢谢

推荐答案

我不确定regsvr32是否有效,您需要运行app.exe/regserver或app.exe/unregserver.

I'm not sure regsvr32 works, you need to run the app.exe /regserver or app.exe /unregserver.

这篇关于如何在DELPHI中编写也是COM服务器的EXE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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