Hi all,
I have another question about COM controls and COM plugin. I have a hidden bar
that hosts MS calendar control. I'd like to customize it a bit...
My first question is: when exactly are COM controls created and released? It
seems that bars (and COM controls) are available when startup script runs.
However, it seems that COM controls are recreated each time PowerPro
configuration changes.
To handle this, I created a small script that will reapply my custom settings
for the calendar control and reset it to today's date:
local com_status
local objCalendar = com.get_object(cl.GetCtrlHandle("Bar_Calendar", "cal"))
objCalendar.GridCellEffect = 0
objCalendar.MonthLength = 2
local strDate = date
objCalendar.Year = stringtofloat(strDate.select(4)).int
objCalendar.Month = stringtofloat(strDate.select(5, 6)).int
objCalendar.Day = stringtofloat(strDate.select(7, 8)).int
com.release(objCalendar)
Bar.ToMouse("Bar_Calendar")
However, when the script is run, two things happen:
- com.get_object shows the bar with the control
- shown control is back to its default settings
Could it be that get_object creates a new instance of the calendar control?
There's another interesting thing: if I change control id from 'cal' to
something that doesn't exist on the bar (e.g. 'call'), get_object will fail.
After that even if I return id to 'cal', get_object will still fail until I
restart PPro.
Thank you,
--
Marko
ICQ: 5990814
I'm not under the alkafluence of inkahol
that some thinkle peep I am.
It's just the drunker I sit here the longer I get.