How to write an EXE which is also a COM Server in Delphi

我只是一个虾纸丫 提交于 2019-12-04 03:33:12

问题


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

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?

Thanks


回答1:


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




回答2:


Is your exe exporting DllRegisterServer and DllUnregisterServer?



来源:https://stackoverflow.com/questions/4376107/how-to-write-an-exe-which-is-also-a-com-server-in-delphi

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