OCX and Forms 5.0

From: Scott Donaldson <scott_donaldson_at_mail.amsinc.com>
Date: 4 Sep 1998 12:00:10 -0500
Message-ID: <01bdd81c$bab749e0$2d7446a2_at_sdonaldson.amsinc.com>



I am trying to implement the MS Winsock 5.0 OCX in Forms 5.0 and am having trouble getting the argument of an event that is needed as an argument to another method for the OCX. Namely, the ConnectionRequest is fired and the RequestID is the input argument. I then need to take this RequestID and pass it as the argument of the Accept method. My question is how do I retrieve this RequestID parameter in Forms? I am a VB programmer and in VB the parameter is passed into the event. How do I get this parameter in the ON-DISPATCH-EVENT trigger. I know the Event number from the OLE Importer.

Here is the code from the Program Unit Package Body that was created from the OLE Importer:

PROCEDURE /* ConnectionRequest */ EVENT2(interface OleObj, requestID IN OUT NUMBER) IS
BEGIN
  NULL;
END; Here is the code from my on-dispatch-event for the OCX: DECLARE
    eventname VARCHAR2(32767) := :system.custom_item_event;     bytesTotal NUMBER;

    data       VARCHAR2(32767);
    maxLen     NUMBER;

    requestID NUMBER;
BEGIN
    IF eventname = 'EVENT0' THEN /*DataArrival*/       bytesTotal :=
MSWinsock_IMSWinsockControl.BytesReceived(:item('PB.ACTIVEX_WINSOCK').interf ace);      

MSWinsock_IMSWinsockControl.GetData(:item('PB.ACTIVEX_WINSOCK').interface, TO_VARIANT(data), TO_VARIANT(VT_BSTR), TO_VARIANT(maxLen));

      :PB.ASYNC_MSGS := :PB.ASYNC_MSGS||'data:'||data;

      :PB.ASYNC_MSGS := data;
      synchronize;
     

MSWinsock_IMSWinsockControl.ole_Close(:item('PB.ACTIVEX_WINSOCK').interface)
;
     

MSWinsock_IMSWinsockControl.Listen(:item('PB.ACTIVEX_WINSOCK').interface);

      synchronize;
    ELSIF eventname = 'EVENT1' THEN /*Connect*/       NULL;
    ELSIF eventname = 'EVENT2' THEN /*ConnectionRequest*/       IF
MSWinsock_IMSWinsockControl.State(:item('PB.ACTIVEX_WINSOCK').interface) != MSWinsockLib_CONSTANTS.sckClosed THEN        

MSWinsock_IMSWinsockControl.ole_Close(:item('PB.ACTIVEX_WINSOCK').interface)
;

      END IF;       MSWinsock_IMSWinsockControl.ole_Accept(:item('PB.ACTIVEX_WINSOCK').interface , requestID);

    END IF;
END; Received on Fri Sep 04 1998 - 19:00:10 CEST

Original text of this message