Forms 4.5 and OLE / OCX usage

From: Fergus <fergus_at_homenet.ie>
Date: Sun, 22 Nov 1998 17:30:30 -0000
Message-ID: <739hte$399$1_at_ezekiel.eunet.ie>



Hi,

I have an MS VB Forms ListBox inside an OLE container on a form to allow multi-select of items from the listbox. It seems to work OK however if I enter the layout editor a second time the OLE container loses its embedded object.

With the code examples below I can set and get properties from the object. I can also use methods like additem, however the text property refused to return any value...

Code to add text to listbox... works fine

declare
arglist ole2.list_type;
whandle ole2.obj_type;
x number;
begin

   arglist := ole2.create_arglist;
   whandle := forms_ole.get_interface_pointer('block2.ole_control3');    ole2.set_property(whandle,'Multiselect',2);

  • Get the next index value to use x := ole2.get_num_property(whandle,'Listcount');
    :block2.text_item11 := x;
    ole2.add_arg(arglist, :block2.text_item9); ole2.add_arg(arglist, x); ole2.invoke(whandle,'AddItem',arglist); end;

Code to get items from listbox ... can get index value of selected item, but not the text value...
declare
whandle ole2.obj_type;
x number;
name varchar2(20);
begin

   synchronize;
   whandle := forms_ole.get_interface_pointer('block2.ole_control3');
:block2.text_item11 := ole2.get_num_property(whandle,'Listindex');
   name := 'List(Listindex)';

  • Tried using local var set to get a list item from array. Not working --:block2.text_item9 := ole2.get_char_property(whandle,name);
    :block2.text_item9 := ole2.get_char_property(whandle,'Text');

end;

The OLE container has the following properties... OLE In-place Activation "False"
OLE Activation Style "Manual"
OLE Resize Style "Scale"

OLE Tenant Types "Embedded"
Show OLE Popup Menu "False"
Show OLE Tenant Type "True"

OLE Do In Out "True"
OLE Tenant Aspect "Content"

If I get this working I will post the fix...

Any ideas,
Fergus. Received on Sun Nov 22 1998 - 18:30:30 CET

Original text of this message