[讨论]BCB6高手技术求解:xdictgrb.dll的抓词问题!
[讨论]BCB6高手技术求解:xdictgrb.dll的抓词问题!复制内容到剪贴板
代码:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleServer, XDICTGRB_TLB, StdCtrls;
type
TForm1 = class(TForm,IXDictGrabSink)
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
GP: IGrabProxy;
public
{ Public declarations }
function QueryWord(const WordString: WideString;lCursorX: Integer;
lCursorY: Integer;const SentenceString: WideString;
var lLoc: Integer; var lStart: Integer): Integer; safecall;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
gp:=CoGrabProxy.Create;
gp.GrabInterval :=1;
gp.GrabMode :=XDictGrabMouse;
gp.GrabEnabled :=true;
gp.AdviseGrab(self);
end;
function TForm1.QueryWord(const WordString: WideString; lCursorX,
lCursorY: Integer; const SentenceString: WideString; var lLoc,
lStart: Integer): Integer;
begin
memo1.Text := memo1.text+SentenceString+#13#10;
end;
end.
用D7就这几句就OK了,BC6都不知道怎么用的
================================================
我在BC6里面是这样写的
void __fastcall TForm1::FormCreate(TObject *Sender)
{
GrabProxy1->set_GrabInterval(1);
GrabProxy1->set_GrabMode(XDictGrabModeEnum(1));
GrabProxy1->set_GrabEnabled(true);
GrabProxy1->AdviseGrab(this);
}
//---------------------------------------------------------------------------
int __fastcall TForm1::QueryWord(const WideString WordString,int lCursorX,int lCursorY,
const WideString SentenceString,int lLoc,int lStart)
{
this->Memo1->Text=SentenceString;
return 1;
}
H文件
#intclude <XDICTGRB_TLB.h>
class TForm1 : public TForm,public IXDictGrabSink
{
__published: // IDE-managed Components
TGrabProxy *GrabProxy1;
TMemo *Memo1;
void __fastcall FormCreate(TObject *Sender);
private: // User declarations
public: // User declarations
int __fastcall QueryWord(const WideString WordString,int lCursorX,int lCursorY,
const WideString SentenceString,int lLoc,int lStart);
__fastcall TForm1(TComponent* Owner);
};
是否我那里引用错了,一运行就提示是纯虚拟函数不能运行
XdictGrb.dll是金山词霸里的一个COM组件 可单独使用 哪个BCB6的高手可以搞定的 请发一下完整代码!!
附件里带了XdictGrb.dll!!!
附件
[img]http://forum.eviloctal.com/images/attachicons/rar.gif[/img][url=http://forum.eviloctal.com/attachment.php?aid=11601]xdictgrb.rar[/url] (48.06 KB)
2008-4-18 15:38, 下载次数: 100 论坛地址: http://www.ssk2.cn & www.iisuser.com
帖子287 精华[url=http://forum.eviloctal.com/digest.php?authorid=1348]14[/url] 积分6821 阅读权限200 性别男 在线时间96 小时 注册时间2005-1-7 最后登录2008-7-17 [url=http://www.iisuser.com]查看个人网站[/url]
[url=http://forum.eviloctal.com/space.php?action=viewpro&uid=1348]查看详细资料[/url][url=http://forum.eviloctal.com/post.php?action=reply&fid=9&tid=32872&repquote=141504&extra=page%3D7&page=1]引用[/url] [url=http://forum.eviloctal.com/misc.php?action=report&fid=9&tid=32872&pid=141504&page=1]报告[/url] [url=http://forum.eviloctal.com/###]回复[/url] TOP [url=http://www.google.cn/search?q=风水&client=pub-0204114945524753&forid=1&prog=aff&ie=UTF-8&oe=UTF-8&cof=GALT%3A#008000;GL%3A1;DIV%3A336699;VLC%3A663399;AH%3Acenter;BGC%3AFFFFFF;LBGC%3A336699;ALC%3A0000FF;LC%3A0000FF;T%3A000000;GFNT%3A0000FF;GIMP%3A0000FF;FORID%3A1&hl=zh-CN]良辰择日,预测咨询,公司改名,权威易经[/url]
[url=http://forum.eviloctal.com/space-uid-1348.html]softbug[/url] [img]http://forum.eviloctal.com/images/avatars/noavatar.gif[/img]
技术核心组
[img]http://forum.eviloctal.com/images/default/star_level2.gif[/img][img]http://forum.eviloctal.com/images/default/star_level2.gif[/img]
页:
[1]