BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

mystics in DoBeforeNavigate2

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Eugene V. Goldberg
Guest





PostPosted: Sun Jun 19, 2005 10:31 am    Post subject: mystics in DoBeforeNavigate2 Reply with quote



I am having hard time writing this BHO thing.

I need to change URL in DoBeforeNavigate2. This code works fine:

procedure DoBeforeNavigate2(const pDisp: IDispatch; var URL: OleVariant; var
Flags: OleVariant; var TargetFrameName: OleVariant; var PostData:
OleVariant; var Headers: OleVariant; var Cancel: WordBool);
begin
if URL<>'http://www.yandex.ru/' then begin
Showmessage('...');
Cancel:=True;
URL:='http://www.yandex.ru';
(pDisp as
IWebbrowser2).Navigate2(URL,Flags,TargetFrameName,PostData,Headers);
end;
end;

But if i comment out IF and have only this

Cancel:=True;
URL:='http://www.yandex.ru';
(pDisp as
IWebbrowser2).Navigate2(URL,Flags,TargetFrameName,PostData,Headers);

it doesnt work at all.

Does anybody have idea whats going on?

Thanx alot,
Eugene.




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.