Problem with HINT.PLL in Dev/2000 V1.2

From: QuadTwin <quadtwin_at_aol.com>
Date: 1997/02/07
Message-ID: <19970207142201.JAA24623_at_ladder01.news.aol.com>#1/1


A while ago, I posted a response to a letter that complained of a rash of GPF's.
I suggested that the problem could be in the hint.pll code provided by Oracle in
the REUSE directory of the Dev/2000 CD.

I can't remember the name of the dll in the GPF, but it was something like DE15WIN.DLL. The problem is that the SHOWHINT.DLL gets mysteriously unloaded when you navigate from one form to another. In our case it was via CALL_FORM.

The code originally provided by Oracle, loads the SHOWHINT.DLL in the initialization section of the package. This implies that the DLL only gets loaded
once for each form. To resolve the problem, you have to be prepared to reload the DLL whenever a hint needs to be displayed.

Here is the original code:



 BEGIN
  IF on_windows THEN
     BEGIN 
       lh_SHOWHINT := ora_ffi.find_library('SHOWHINT.DLL');
     EXCEPTION WHEN ora_ffi.FFI_ERROR THEN 
       lh_SHOWHINT := ora_ffi.load_library(NULL,'SHOWHINT.DLL');
     END ;
     fh_DisplayHint := ora_ffi.register_function(lh_SHOWHINT,

'DisplayHint',ora_ffi.C_STD);
ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_CHAR_PTR); ora_ffi.register_return(fh_DisplayHint,ORA_FFI.C_INT);
  END IF;
END HINT;

Delete, the code from BEGIN to END IF; (leaving END HINT as the only remaining statement). Then use the following code: Note that load_dll is a new procedure that I wrote. Also note that this new procedure is called prior to displaying the hint. While I have made other extensively changes to the original hint.pll code, I think your version of DisplayHint should match mine with the exception of the call to load_dll. But be cautious!

FUNCTION DisplayHint
  (AppInstance IN PLS_INTEGER,
  HWnd IN PLS_INTEGER,
  PosSq IN PLS_INTEGER,
  x IN PLS_INTEGER,
  y IN PLS_INTEGER,
  message IN VARCHAR2)
  RETURN PLS_INTEGER IS
  AppInstance_l PLS_INTEGER := AppInstance;   HWnd_l PLS_INTEGER := HWnd;
  PosSq_l PLS_INTEGER := PosSq;

  x_l PLS_INTEGER := x;
  y_l PLS_INTEGER := y;
  message_l VARCHAR2(512) := message;
  BEGIN
       load_dll;  -- Recommended fix from Oracle support for R1.2
       rc  := i_DisplayHint(fh_DisplayHint,
	      AppInstance_l,
	      HWnd_l,
	      PosSq_l,
	      x_l,
	      y_l,
	      message_l);

    RETURN (rc);
  END ;   PROCEDURE load_dll IS
  BEGIN
    IF on_windows THEN
     BEGIN
     lh_SHOWHINT := ora_ffi.find_library('SHOWHINT.DLL');
     EXCEPTION WHEN ora_ffi.FFI_ERROR THEN 
       lh_SHOWHINT := ora_ffi.load_library(NULL,'SHOWHINT.DLL');
     END ;
     fh_DisplayHint := ora_ffi.register_function(lh_SHOWHINT,

'DisplayHint',ora_ffi.C_STD);
ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_DisplayHint,ORA_FFI.C_CHAR_PTR); ora_ffi.register_return(fh_DisplayHint,ORA_FFI.C_INT);
    END IF;
  END; I hope this helps those who expressed an interest in this problem. Some of you sent me some
email and unfortunately your letters were deleted by AOL before I could respond (I was down with
the flu for a week).

Good Luck,

Al Received on Fri Feb 07 1997 - 00:00:00 CET

Original text of this message