Creating ATL controls for Excel..
I'm trying to create an extended label control that will be used within
Excel. It is ATL/WTL and subclasses the CStatic control.
My problem is that when the control gets added to a sheet using
ActiveSheet.OLEObjects.Add it always seems to appear in design mode -
ie. not activated. If I toggle design-mode the control then displays
correctly.
Having debugged I notice that OnCreate does not get called until I
toggle design-mode.. OnDraw does get called but I require a window
handle which is not available at this point..
Am I missing some activation property/method or should I be creating my
own window when I realise that one does not exist?
Thanks!
|