Creating an activex object before you display it
Publicado: Mar Abr 01, 2008 1:01 am
Hi Jose
I have added the Outlook 2003 Shortcut bar to my app now
When I add the Shortcut Items I can pass a window handle , this window is then displayed in the top part of the control when I select this shortcut item. For example I have one called Calendar and when I click it, it shows the DatePicker control in the top part....Just like Outlook.
Here's my issue, I need to create the DatePicker object so I can get to it's handle. Problem is I don't want to display it.
I do this, but unless I pass in a control into the New() I get a NIL error
WITH OBJECT ::oDatePicker := TDatePicker():New(::oPanel3)
:nAlign := alClient
:nWidth := 100
:nHeight := 300
:Create()
END
I then use the handle here, at this point the
aItems := Array(5)
WITH OBJECT ::oBar := TShortcutBar():New(::oPanel2)
:nAlign:=alClient
:nWidth := 100
:nHeight := 300
:Create()
aItems[1] := :AddItem(0,"Calendar",::oDatePicker:hWnd)
aItems[2] := :AddItem(1,"Jobs", )
aItems[3] := :AddItem(2,"Companies",)
aItems[4] := :AddItem(3,"Contacts",)
aItems[5] := :AddItem(4, "Settings", )
:ExpandedLinesCount := 6
END
I have tried using self, but that makes the DataPicker appear on Form1
I'm using oPanel3 and hiding it at the moment.
How can I get the handle of the window without passing in a Control into the New() method?
Cheers
Nick
--
I have added the Outlook 2003 Shortcut bar to my app now
When I add the Shortcut Items I can pass a window handle , this window is then displayed in the top part of the control when I select this shortcut item. For example I have one called Calendar and when I click it, it shows the DatePicker control in the top part....Just like Outlook.
Here's my issue, I need to create the DatePicker object so I can get to it's handle. Problem is I don't want to display it.
I do this, but unless I pass in a control into the New() I get a NIL error
WITH OBJECT ::oDatePicker := TDatePicker():New(::oPanel3)
:nAlign := alClient
:nWidth := 100
:nHeight := 300
:Create()
END
I then use the handle here, at this point the
aItems := Array(5)
WITH OBJECT ::oBar := TShortcutBar():New(::oPanel2)
:nAlign:=alClient
:nWidth := 100
:nHeight := 300
:Create()
aItems[1] := :AddItem(0,"Calendar",::oDatePicker:hWnd)
aItems[2] := :AddItem(1,"Jobs", )
aItems[3] := :AddItem(2,"Companies",)
aItems[4] := :AddItem(3,"Contacts",)
aItems[5] := :AddItem(4, "Settings", )
:ExpandedLinesCount := 6
END
I have tried using self, but that makes the DataPicker appear on Form1
I'm using oPanel3 and hiding it at the moment.
How can I get the handle of the window without passing in a Control into the New() method?
Cheers
Nick
--