求使软件支持插件或应用功能的思路
看到很多知名的软件都有插件或应用功能,知道这是对软件的一种扩展.
但不知道其工作原理,软件与插件(应用)是如何对接,协调工作的.
麻烦做过或了解的高手们讲解一下,谢谢.!
[解决办法]
这个啊,有点麻烦的,我大概地说一点顺序吧,你可以网上去搜索的
第一步,用VB做一个activeX工程,生成dll文档。
当然,在做这个文档时要把接口以及功能自己搞明白。
第二步,在系统中注册这个dll
第三步,在其它程序(比如ASP)中定义并引用这个dll(就是调用上面的接口)。这样就可以在其它程序中实现原本无法实现的功能。
[解决办法]
你可以考虑用 COM 接口和 API,
但无论那种接口,都需要一个固定的模型,如:
Public Sub ShowWindow()
MainWindow.Show
End Sub
Public Sub CloseWindow()
Unload MainWindow
Set MainWindow = Nothing
End Sub
Public Property Get Icon() As StdPicture
Set Icon = MainWindow.Icon
End Property
Public Property Get Caption() As String
Caption = MainWindow.Caption
End Property
Public Property Get hWnd() As Long
hWnd = MainWindow.hWnd
End Property
Public Sub DelClick()
MainWindow.删除操作
End Sub
Public Sub PlasterClick()
MainWindow.粘贴操作
End Sub
Public Sub CopyClick()
MainWindow.复制操作
End Sub
Public Sub CutClick()
MainWindow.剪切操作
End Sub
Public Sub PrinterClick()
MainWindow.打印操作
End Sub
Public Property Get isDel() As Boolean
isDel = True
End Property
Public Property Get isPlaster() As Boolean
isPlaster = True
End Property
Public Property Get isCopy() As Boolean
isCopy = True
End Property
Public Property Get isCut() As Boolean
isCut = True
End Property
Public Property Get isPrinter() As Boolean
isPrinter = True
End Property
Public Property Get isPrintSetup() As Boolean
isPrintSetup = False
End Property
Public Property Let ParenthWnd(ByVal vData As Long)
ParentWindow = vData
End Property
Public Property Get ParenthWnd() As Long
ParenthWnd = ParentWindow
End Property
Public Property Let ConnectionString(ByVal vData As String)
ConnectionSQL = vData
End Property
Public Property Get ConnectionString() As String
ConnectionString = ConnectionSQL
End Property
Private Sub Class_Initialize()
Set MainWindow = MainForm
End Sub