Imports XDICTGRB '引用命名空间
Public Class Form1
Implements IXDictGrabSink '继承 '引用DLL中的方法
'定义一个类
Public gp As GrabProxy 'DLL中的属性
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'创建一个新实例
gp = New GrabProxy
'在gp 里面设置一些相关属性
gp.GrabInterval = 1000 ‘设置取词时间间隔为1秒
gp.GrabMode = 1 ‘设置取词方式为鼠标取词
gp.GrabEnabled = True ‘设置取词功能有效
'设置属性后,把接口指向自身
dwCookie = gp.AdviseGrab(Me)
<type 'classobj'>
Traceback (most recent call last):
File "D:\pyWorkspace\test1\src\11.py", line 23, in <module>
a=MyGrab()
File "D:\pyWorkspace\test1\src\11.py", line 19, in __init__
self.gp.AdviseGrab(self)
File "D:\pyWorkspace\test1\src\ttttt.py", line 49, in AdviseGrab
return self._oleobj_.InvokeTypes(7, LCID, 1, (3, 0), ((9, 1),),XDictGrabSink
ValueError: argument is not a COM object (got type=str)