哪个 ActiveX 控件(*.ocx 文件)处理 WMI? [英] Which ActiveX control (*.ocx file) handles WMI?

查看:94
本文介绍了哪个 ActiveX 控件(*.ocx 文件)处理 WMI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我问了

提前致谢
多米尼克

解决方案

首先,正如 Mike 提到的,不要费心走 ocx 的道路.

之后您可以添加引用:

Yesterday I asked this question about launching a commandline in OpenEdge Progress-4GL and catching the results.

Although it works fine, I wonder why I would not simply use a WMI API instead: as described in this webpage about WMI API this is possible for a Windows related programming environment, handling ActiveX objects (see "Developer audience" chapter).

I'm working in OpenEdge Progress-4GL, release 11.6, using the AppBuilder. This makes it possible to add an ActiveX control on a window, but the list of available controls does not mention any WMI (or Windows Management) related control, so I assume I need to browse for it on my computer (or download it), and here's the question:

Which *.ocx file covers WMI API (and how can I use it)?

Edit after comment on first answer: Appbuilder's Tools menu

This is what my AppBuilder's "Tools" menu looks like:

Thanks in advance
Dominique

解决方案

First, as Mike mentioned, do not bother going down the ocx road.

The System.Management.ManagementScope class is located in the .Net System.Management.dll. To use a .Net dll it needs to be added to the assembly.

Important notice for AppBuilder users

Some developers start their development, working with the AppBuilder (the shortcut, starting the development, contains C:\Progressx86\OpenEdge\bin\prowin32.exe ... -p _ab.p ...). Starting the procedure editor from this point won't work, as some menu items will be missing.
In order to cope with this, start working with C:\Progressx86\OpenEdge\bin\prowin32.exe (without any parameters). This will start up the procedure editor, containing the needed menu items.

With Progress Developer Studio for OpenEdge you just add it and then you can use it. Adding the assembly via the GUI results in the following assemblies.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<references>
<assembly name="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</references>

When you have this assemblies.xml, you can just use:

DEFINE VARIABLE oMgmtScope AS System.Management.ManagementScope NO-UNDO.

To add assemblies without Progress Developer Studio for OpenEdge you can use the procedure editor, menu entry [ Tools / Assembly References ]:

After which you can add references:

这篇关于哪个 ActiveX 控件(*.ocx 文件)处理 WMI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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