COM - PowerBuilder 的控件
如何使用PowerBuilder中的com控件?如果它在应用程序中使用..我如何识别它?
how to use the com controls in PowerBuilder ? If it is used in an application.. how can i identify it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,最好向您介绍手册,这些手册可在线和产品磁盘上获取,因为您没有提到您正在使用的 PowerBuilder 版本,也没有提到您关心的 COM 对象的类型,所以这个答案可能是偶然的。我假设您指的是可视 COM 控件。
将其放置在窗口或用户对象上非常容易,使用菜单项“插入/控件/OLE...”,然后从对话框中选择所需的 OLE 控件。下拉工具栏项中还有一个选项列出了所有控件。一旦它位于窗口或用户对象上,您就可以像任何其他控件一样在其上编写事件脚本。
要确定窗口或用户对象上的给定控件是否是 COM 可视控件,如果选择它,“属性”窗格上的标题将显示类似“从 olecustomcontrol 继承的 ole_1”的内容。如果您正在查看对象的“编辑源”视图,请搜索“from olecustomcontrol”。您可以类似地在应用程序中搜索该字符串,以找出使用 COM 控件的位置(至少在继承的第一级;确定每个位置将更加复杂,同时查找也使用 COM 的对象的后代)。
祝你好运,
特里。
To start with, it'd probably be good to point you towards the manuals, available online and on the product disks, as you don't mention the version of PowerBuilder you're using, and you don't mention the type of COM object you're concerned about, so this answer may be hit and miss. I'm going to assume you're referring to a visual COM control.
Placing it on a window or user object is pretty easy, with the menu item Insert / Control / OLE..., then select the desired OLE control from the dialog. There's also an option in the drop down toolbar item that lists all the controls. Once it's on the window or user object, you can script events on it just like any other control.
To determine if a given control on a window or user object is a COM visual control, if you select it, the title on the Properties pane will say something like "ole_1 inherited from olecustomcontrol". If you're looking at the Edit Source view of the object, search for "from olecustomcontrol". You can similarly do a search across your application for that string to find out where COM controls are used (at least at the first level of inheritance; determining every place will be more complex, looking for descendants of objects that use COM as well).
Good luck,
Terry.