有人知道如何为PowerDesigner开发外接程序吗?我正在阅读PowerDesigner关于如何创建ActiveX外接程序的文档,其中写道"ActiveX必须实现一个名为IPAddIn的特定接口才能成为PowerDesigner外接程序。"。但我不知道IPAddIn接口在哪里,以及如何实现它?这是在线文档
我有一个旧的例子,它可以提供一些想法,即使不是所有的东西都是最新的。
using PdAddInTypLib;
namespace MineSpace
{
[ComVisible(true)]
[Guid("A6FA0D26-77E8-4DD3-B27E-F4050C3D5188")]
public class Launcher : IPdAddIn {
// Main() manages the console or GUI interface
// the PdAddIn interface is managed by an instance of Launcher
[ComVisible(false)]
[STAThread]
public static void Main(String[] args) {
}
public Launcher() {
_app = null;
}
// IPdAddIn implementation
public void Initialize(Object anApplication) {
try {
_app = (PdCommon.Application)anApplication;
}
catch (Exception e) {
// process
}
}
public void Uninitialize() {
}
public String ProvideMenuItems(String aMenu, Object anObj) {
return "";
}
public int IsCommandSupported(String aMenu, Object anObj, String aCommand) {
return 0;
}
public void DoCommand(String aMenu, Object anObj, String aCommand) {
}
private PdCommon.Application _app;
}
}
类声明中的相应部分:
[HKEY_CLASSES_ROOTMyPlugin.Launcher]
@="MyPlugin.Launcher"
[HKEY_CLASSES_ROOTMyPlugin.LauncherCLSID]
@="{13749EFC-1ADA-4451-8C47-FF0B545FF172}"
[HKEY_CLASSES_ROOTCLSID{13749EFC-1ADA-4451-8C47-FF0B545FF172}]
@="MyPlugin.Launcher"
[HKEY_CLASSES_ROOTCLSID{13749EFC-1ADA-4451-8C47-FF0B545FF172}InprocServer32]
@="C:windowsSystem32mscoree.dll"
"ThreadingModel"="Both"
"Class"="MyPlugin.Launcher"
"Assembly"="MyPlugin, Version=1.0.1402.33688, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v1.0.3705"
[HKEY_CLASSES_ROOTCLSID{13749EFC-1ADA-4451-8C47-FF0B545FF172}ProgId]
@="MyPlugin.Launcher"
[HKEY_CLASSES_ROOTCLSID{13749EFC-1ADA-4451-8C47-FF0B545FF172}Implemented Categories{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]
以及在PowerDesigner中声明外接程序的相应代码。如果存在File
值,则如果组件尚未注册,PowerDesigner可以对其调用DllRegisterServer。
[HKEY_LOCAL_MACHINESOFTWARESybasePowerDesigner 10AddinsMyPlugin Launcher]
"Enable"="No"
"Class"="MyPlugin.Launcher"
"Type"="ActiveX"
"File"="d:\myplugin\myplugin.exe"