Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to display a Word document in form?

Re: How to display a Word document in form?

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Wed, 09 Oct 2002 14:27:08 +0200
Message-ID: <ao17dc$c9f$1@ctb-nnrp2.saix.net>


Nick wrote:

> ole_item := FIND_ITEM('main_block.help_doc');
> IF NOT ID_NULL(ole_item)
> THEN
> Forms_OLE.Initialize_Container(ole_item, 'C:\help.doc');
> END IF;
>
> IF Forms_OLE.Server_Active(ole_item) = FALSE
> THEN
> Forms_OLE.Activate_Server(ole_item);
> END IF;
>
> But I got FRM-41344: OLE object not defined for help_doc in the urrent
> record
> Damn it , What's wrong? I obviously initialized the OLE object!

Try Michael suggestion in adding a delay.

But I'm not sure that that Michael diagnosed the error he got correctly. The Win32 CoCreateInstance() API call used to create an OLE object is a blocking call. It will only return the object's pointer/reference to you _after_ it has been constructed. Assuming that the call succeeded, you will have a constructed object, a valid reference, and are able to call methods of that object. Unless of course Forms deal with this differently...

Anyway, what I think could be the problem (keeping in mind that I know _nothing_ about the Forms language).

You say:
IF NOT ID_NULL(ole_item)

There are two "null" states when dealing with variant objects. Empty and Null.

Empty means that the variant is unsassigned.

Null means that the variant is (obviously) null.

When you do a FIND_ITEM(), what does it return when it fails? An unassigned variant or a null variant?

A IS_VARIANT_NULL( variant ) will return false for an unassigned variant - mistakenly letting you believe that you do have a constructed object. I had a similar problem when dealing with a speech recognition object that returns an empty (and not null) interface to the recognised speech's Ole property object when there are no properties defined in the grammer rule for that speech phrase.

Unassigned and Null are defined as hex values $0000 and $0001 respectively in the Pascal (Delphi) header files for dealing with OLE objects.

--
Billy
Received on Wed Oct 09 2002 - 07:27:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US