HOWTO: Getting IHlinkFrame from Within a Hyperlink Target

Last reviewed: January 19, 1998
Article ID: Q174393
The information in this article applies to:
  • Microsoft ActiveX SDK, version 1.0
  • Internet Client SDK, versions 4.0, 4.01
  • Microsoft Internet Explorer (Programming), versions 3.0, 3.01, 3.02, 4.0, 4.01

SUMMARY

In an example in the Hyperlinking section of the documentation, the Internet Client SDK indicates that an Active Document application can retrieve the IHlinkFrame interface from its container by calling QueryInterface on the container's IOleInPlaceFrame object and asking for IID_IHlinkFrame.

For Internet Explorer (IE), this will fail. The correct way to retrieve IHlinkFrame is through the IServiceProvider interface.

MORE INFORMATION

Here is sample code that demonstrates the correct method for retrieving Internet Explorer's IHlinkFrame interface:

   IHlinkFramePtr pHLFrame;
   IOleClientSitePtr pCS = m_lpClientSite;
   IServiceProviderPtr pSP = pCS;
   pSP->QueryService(SID_SHlinkFrame, IID_IHlinkFrame,
      (void**)&pHLFrame);

In an MFC Active Document server, the IOleClientSite interface can be retrieved from within the document class using the m_lpClientSite protected member of COleServerDoc.

REFERENCES

This sample uses Visual C++ 5.0 COM-support syntax. Please refer to the Visual C++ 5.0 documentation for discussion on these smart pointers:

Visual C++ Books Online: Visual C++; Visual C++ Programmer's Guide; Adding Program Functionality; Overviews; Compiler COM Support: Overview

Keywords          : AXSDKMisc
Technology        : kbInetDev
Version           : WINDOWS:1.0,3.0,3.01,3.02,4.0,4.01
Platform          : WINDOWS
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 19, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.