PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Andy Flowers on November 07, 2009, 10:41:07 AM

Title: COM Control Events
Post by: Andy Flowers on November 07, 2009, 10:41:07 AM
What is the difference between these to calls to monitor com ctrl events?
pRangerEvents is the Events Interface.

"EVENTS FROM Ranger CALL pRangerEvents"
and
"OC_Advise HWND_FORM1_OCXCONTROL1, pRangerEvents
Title: Re: COM Control Events
Post by: José Roca on November 07, 2009, 01:18:27 PM
 
With EVENTS FROM Ranger CALL pRangerEvents you have to declare pRangerEvents as global or static and later call EVENTS END pRangerEvents in your program before the control is destroyed. OC_Advise HWND_FORM1_OCXCONTROL1, pRangerEvents keeps a reference alive during the life of the control, so pRangerEvents can be local, and calls EVENTS END for you when the control is destroyed.

Use the one that you prefer.