In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Creating an activex object before you display it

Xailer professional forum in English
Nick Hilder
Mensajes: 328
Registrado: Mar Nov 21, 2006 2:10 am

Creating an activex object before you display it

Mensaje por Nick Hilder »

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
--
Responder