[VB.NET]在VB.NET中为什么引用了金山词霸的xdictgrb.dll文件还是不能实现鼠标取词呢?

在VB.NET中为什么引用了金山词霸的xdictgrb.dll文件还是不能实现鼠标取词呢? 我在VB.NET中添加引用了金山词霸的xdictgrb.dll文件,然后直接copY了下面这段程序但是出现了很多错误。 Option Explicit Implements IXDictGrabSink Private gp As GrabProxy Private Sub Form_Load() Set gp = New GrabProxy With gp .GrabEnabled = True .Grabinterval = 30 .GrabMode = XDictGrabMouse .AdviseGrab Me End With End Sub Private Function IXDictGrabSink_QueryWord(ByVal WordString As String,ByVal lCursorX As Long,ByVal lCursorY As Long,ByVal SentenceString As String,lLoc As Long,lStart As Long) As Long Label1.Caption = "( " & lCursorX & "," & lCursorY & ") " Label2.Caption = "当前语句: " & SentenceString Label3.Caption = "当前字符: " & Mid(SentenceString,lLoc + 1,1) End Function 错误 1 未定义类型“IXDictGrabSink”。      2 未定义类型“GrabProxy”。      3 未定义类型“GrabProxy”。 4 未声明名称“XDictGrabMouse”。      5 “Caption”不是“System.Windows.Forms.Label”的成员。      是不是还要添加什么定义呢? __________________________________________________________________________ ding __________________________________________________________________________ imports XDICTGRB 试一下 __________________________________________________________________________ 你的 是vb代码,不是vb.net的 代码 给你个C#的 在金山词霸中2005中带了一个XdictGrb.dll,添加引用 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Text; using System.Windows.Forms; using XDICTGRB;//金山词霸组件 namespace WindowsApplication1 { public partial class Form1 : Form,IXDictGrabSink { public Form1() { InitializeComponent(); } private void Form1_Load(object sender,EventArgs e) { GrabProxy gp = new GrabProxy(); gp.Grabinterval = 1;//指抓取时间间隔 gp.GrabMode = XDictGrabModeEnum.XDictGrabMouse;//设定取词的属性 gp.GrabEnabled = true;//是否取词的属性 gp.AdviseGrab(this); } //接口的实现 int IXDictGrabSink.QueryWord(string WordString,int lCursorX,int lCursorY,string SentenceString,ref int lLoc,ref int lStart) { this.textBox1.Text = SentenceString;//鼠标所在语句 //this.textBox1.Text = SentenceString.Substring(lLoc + 1,1);//鼠标所在字符 return 1; } } } __________________________________________________________________________ oho 被楼上的说了 __________________________________________________________________________

相关文章

Format[$] ( expr [ , fmt ] ) format 返回变体型 format$ 强...
VB6或者ASP 格式化时间为 MM/dd/yyyy 格式,竟然没有好的办...
在项目中添加如下代码:新建窗口来显示异常信息。 Namespace...
转了这一篇文章,原来一直想用C#做k3的插件开发,vb没有C#用...
Sub 分列() ‘以空格为分隔符,连续空格只算1个。对所选...
  窗体代码 1 Private Sub Text1_OLEDragDrop(Data As Dat...