Microsoft KB Archive/130275

= How to Implement OLE Custom Control Context Sensitive Help =

Article ID: 130275

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft ActiveX SDK

-



This article was previously published under Q130275



SUMMARY
An OLE Custom Control can provide context sensitive help on the currently selected control, property, or event by modifying the .ODL file. This article shows by example how to implement it.



MORE INFORMATION
The help file for GENERIC is given by the helpfile attribute in the library declaration in the GENERIC.ODL file. In the following code, GENERIC.HLP is the help file for the custom control. [uuid(5CE3E2E3-8D26-101B-B883-444553540000), version(1.0), helpstring("GENERIC OLE Custom Control module"), helpfile("GENERIC.HLP")] library GENERICLib The associated GENERIC.HPJ file lists helpcontext attributes for each of the help subjects: [MAP] GENERIC                   10 GenericShape            50 FlashColor                 60 ClickIn                       70 ClickOut                    80 To specify the help topic ID for help on the control, add the helpcontext attribute of 10 to the coclass declaration in GENERIC.ODL; the following code demonstrates this: [ uuid(5CE3E2E0-8D26-101B-B883-444553540000), helpstring("GENERIC Control"), helpcontext(10)] coclass CGENERIC To specify the help topic ID for a control property, add the helpcontext attribute to the property declaration in the property list. The following code demonstrates a help context ID of 50 and 60 for the GenericShape and FlashColor properties respectively: [ uuid(5CE3E2E1-8D26-101B-B883-444553540000), helpstring("Dispatch interface for GENERIC Control") ] dispinterface _DGENERIC {           properties: // NOTE - ClassWizard will maintain property information here. //   Use extreme caution when editing this section. //AFX_ODL_PROP To specify the help topic ID for a control event, add the helpcontext attribute to the event declaration in the event list. The following code demonstrates a help context ID of 70 and 80 for the ClickIn and ClickOut events respectively: [ uuid(5CE3E2E2-8D26-101B-B883-444553540000), helpstring("Event interface for GENERIC Control") ] dispinterface _DGENERICEvents {           properties: // Event interface has no properties

methods: // NOTE - ClassWizard will maintain event information here. //   Use extreme caution when editing this section. //AFX_ODL_EVENT };

Additional query words: 2.00 OCX

Keywords: kbctrl kbcode KB130275

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.