从现有对象创建 Delphi Activex 服务器
在 Delphi 中,将 ActiveX 对象添加到项目中的过程相当简单 - 您导入类,Delphi 围绕它包装处理程序,几秒钟内就完成了。我想做的是创建一个类连接的服务器而不是类的客户端。
我正在研究的具体案例是 OPOS 打印机驱动程序。我想将 OPOS 打印机驱动程序接口添加到现有程序中,以便 OPOS 控制对象可以将我的程序视为另一个打印机对象类。我可以轻松地将打印机类型库作为我的客户端组件导入,但我不确定我需要做什么才能成为对话的另一方。我怀疑我以错误的方式看待某些事情,但我找到的几乎所有参考资料都假设我想成为客户端或者我想定义一个全新的服务器。我也是一个 COM 新手,所以有点困惑。我一直在使用 XE 和 D7,并根据打印机控件创建了一个 tlb,但显然还没有完全能够让它飞起来。
有人能在这里给我一个正确的方向吗?
In Delphi the process of adding an activex object to a project is fairly simple - you import the class and Delphi wraps handlers around it and you're done in seconds. What I'm wanting to do though is create a server that the class connects to rather than a client for the class.
The specific case I'm working on is with OPOS printer drivers. I want to add an OPOS printer driver interface to an existing program so that the OPOS control objects can see my program as just another printer object class. I can readily import the printer type library as a component that I'm a client of, but I'm unsure what I need to do to be the other side of that conversation. I suspect I'm looking at something the wrong way but pretty much all the reference material I've found assumes I want to be a client or that I want to define an entirely new server. I'm also a COM newbie so it's a little confusing. I've been playing with XE and D7, and have created a tlb as per the printer control but obviously haven't quite been able to get it to fly.
Can anyone give me a nudge in the right direction here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论