 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Zarkas Guest
|
Posted: Thu Feb 05, 2004 1:02 pm Post subject: Getting url of current IE |
|
|
Ran into a strange problem today.
Made a small program that added a button to IE and launched my com
object when i clicked on it.
In the com object i implemented the IObjectWithSite interface and
stored the IWebBrowser2 i got from the setsite function.
When only using one browser it works great, but if there are 2 or more
browers my geturl function often returns the url of one of the other
browsers.
Any suggestions to how i get the currently active browsers url only?
function TTmywhois.SetSite(const pUnkSite: IUnknown): HResult;
var
Sp: IServiceProvider;
begin
if Assigned(pUnkSite) then begin
punkSite.QueryInterface(IID_IInputObjectSite, m_pSite);
cmdTarget := pUnkSite as IOleCommandTarget;
Sp := CmdTarget as IServiceProvider;
Sp.QueryService(IWebbrowserApp, IWebbrowser2, IE);
end;
Result := S_OK;
end;
function TTmywhois.GetSite(const riid: TIID;
out site: IUnknown): HResult;
begin
result :=S_OK;
end;
function TTmywhois.GetUrl: string;
begin;
result :=IE.LocationUrl;
end;
|
|
| Back to top |
|
 |
|
|
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
|
|