Home » Developer & Programmer » Forms » Unknown Forms failure in create_obj in CLIENT_OLE2 when communicating with COM (Oracle Application Server 10g Enterprise, 10.1.2.0.2, win xp sp2)
icon5.gif  Unknown Forms failure in create_obj in CLIENT_OLE2 when communicating with COM [message #413888] Sat, 18 July 2009 02:07 Go to next message
modulo2
Messages: 8
Registered: July 2009
Location: Saudi Arabia
Junior Member
Dears,
I have a code running fine in forms 6, this code communicates with external COM located in client machine. I'm migrating the application to 10g and using WebUtil for OLE2 communication based on Oracle article "HOW TO - Performing OLE on the client using WebUtil". The code is failing in create_obj method in CLIENT_OLE2

The code is as follows:
DECLARE
  sd CLIENT_OLE2.OBJ_TYPE;
  args CLIENT_OLE2.LIST_TYPE;
BEGIN
  sd := CLIENT_OLE2.CREATE_OBJ('yyy.xxxcom');
  CLIENT_OLE2.SET_PROPERTY(sd,'p1',1);
  -- ...
END;


I just find the browser is not returning anything, as if it is hanging. Trying to solve the issue I got the code for create_obj from webutil.pll and tried to call it for debugging the issue:

 FUNCTION create_obj(object IN VARCHAR2) RETURN CLIENT_OLE2.OBJ_TYPE is
    v_objHandle CLIENT_OLE2.OBJ_TYPE;
    v_javaHandle varchar2(6);
  BEGIN
    MSG(4,4,0);
    -- check if OLE object name is valid
    if  ((object is null) or (object = '')) then
      raise CLIENT_OLE2.OLE_ERROR;
    end if;
    WebUtil_Core.setProperty(WebUtil_Core.WUO_PACKAGE,'WUO_OLE2_OBJNAME',object);
    MSG(6,6,0);    
    v_javaHandle := WebUtil_Core.getProperty(WebUtil_Core.WUO_PACKAGE,'WUO_OLE2_CREATE_OBJ');

    -- check if the OLE Object handle is valid
    if (v_javaHandle is null) or (v_javaHandle='') or (v_javaHandle='-1') then
      raise CLIENT_OLE2.OLE_ERROR;
    end if;
    MSG(7,7,0);    
    v_objHandle := to_number(v_javaHandle);
    MSG(8,8,0);        
    return(v_objHandle);
  EXCEPTION
    when WebUtil_Core.BEAN_NOT_REGISTERED then 
        MSG('N','N',0);
      WebUtil_Core.ErrorAlert(WebUtil_Core.getImplClass(WebUtil_Core.WUO_PACKAGE)
                              ||' bean not found. CLIENT_OLE2.create_obj will not work');
      RAISE CLIENT_OLE2.OLE_ERROR; 
    when WebUtil_Core.PROPERTY_ERROR then 
    MSG('T','T',0);
      RAISE CLIENT_OLE2.OLE_ERROR;
    when VALUE_ERROR then
    MSG('V','V',0);
      RAISE CLIENT_OLE2.OLE_ERROR; 
    when CLIENT_OLE2.OLE_ERROR then 
    MSG('O','O',0);
      RAISE FORM_TRIGGER_FAILURE;

 END create_obj;


The problem happens in line (
v_javaHandle := WebUtil_Core.getProperty(WebUtil_Core.WUO_PACKAGE,'WUO_OLE2_CREATE_OBJ');
) there is something wrong and it is not even caught by exception clause mentioned above.

Can anyone help?

Ashraf Fouad
Re: Unknown Forms failure in create_obj in CLIENT_OLE2 when communicating with COM [message #414609 is a reply to message #413888] Wed, 22 July 2009 22:55 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you solved your problem? Have you reviewed the other threads containing 'CLIENT_OLE2.CREATE_OBJ'?

David
Re: Unknown Forms failure in create_obj in CLIENT_OLE2 when communicating with COM [message #418119 is a reply to message #414609] Thu, 13 August 2009 01:34 Go to previous messageGo to next message
modulo2
Messages: 8
Registered: July 2009
Location: Saudi Arabia
Junior Member
I have searched the forum previously, I have found similar problem with no answer:
message #384440
With subject: Use of Webutil Library to export to Excel
Sorry I could not post URL as per forum rules.
Re: Unknown Forms failure in create_obj in CLIENT_OLE2 when communicating with COM [message #418134 is a reply to message #418119] Thu, 13 August 2009 02:10 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Interstingly there are only three posts in this forum that uses 'WebUtil_Core.getProperty' and that includes your original post in this thread.

You mention "HOW TO - Performing OLE on the client using WebUtil". Is its link http://www.oracle.com/technology/products/forms/htdocs/webutil/howto_ole.html ?

Do you have a 'pause;' in your 'msg' procedure? Please post the code for 'msg'.

Did you do a Ctrl-Shft-K (Compile All) before the Ctrl-t (Generate)?

David
Re: Unknown Forms failure in create_obj in CLIENT_OLE2 when communicating with COM [message #418405 is a reply to message #418134] Fri, 14 August 2009 14:56 Go to previous message
modulo2
Messages: 8
Registered: July 2009
Location: Saudi Arabia
Junior Member
yes this is the posting.

The MSG is just displaying a dialog to display the values for debugging purposes.

Yes the code compiled, and is working fine in forms 6.
Previous Topic: How to transfer records from one datablock to another datablock with in the form
Next Topic: PL/SQL assigning SELECT statement to variable (merged)
Goto Forum:
  


Current Time: Wed Dec 07 06:51:23 CST 2016

Total time taken to generate the page: 0.14470 seconds