ORA_FFI
I want to use d2kwutil package and I want to test if in registry is the key
Win_API_Environment.Read_Registry('HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE', 'D2KWUTIL60_PATH', TRUE);
In case of error I want to create 'D2KWUTIL60_PATH' and to give the proper value.
Can anybody know how to create the 'D2KWUTIL60_PATH' in registry and to give a value to it using ora_ffi ?
Thx.
Ovidiu
Thanks again for your time Duncan
My email is [email protected].. you can send anything you have on this issue,i don't have space limitt for my account...
In fact my real problem is that a customer using a language with a kirilic char set,wants to use a system with english forms modules...I can have a single charset in forms runtime,so i must use a font for 3 or 4 specific fields(the rest of them will remain english) for wich I'll set the font to arial kirilic using c...I'm afraid that not only those items will change their font,but will see...they can be placed on a different window,if other doesn't work..
If you have a better suggestion for this ,I'll be glad..
Thanks for your time again
Similar Messages
-
Convert ORA_FFI to WEBUTIL_C_API to print locally
I am trying to figure out how to convert this package to WEBUTIL_C_API to be able to print to a users local printer (EPSON slip printer)... ANY help would be appreciated...
PACKAGE EPSON_SLIP_PRINTER_INTERFACE IS
* This package provides functions to interact with the EPSON
* TM-U295 slip printers.
* The OPEN_PRINTER function must be called to obtain a printer ID.
* This printer ID can then be used when calling other functions
* that require a printer to be specified.
* NOTE that the printer ID is only valid within the same thread
* that called the OPEN_PRINTER function.
* Brendan Rickey 2004-JAN-09
-- AVAILABLE PRINTERS
CHEQUE_PRINTER VARCHAR2(50) := 'Generic / Text Only droite';
INVOICE_PRINTER VARCHAR2(50) := 'Generic / Text Only left';
-- ERROR CODES
-- Some of the provided functions return a NUMBER value that may hold
-- an error code (negative number).
-- These are the possible error codes:
SUCCESS NUMBER := 0; --no error
ERR_TYPE NUMBER := -10; --parameter type error
ERR_OPENED NUMBER := -20; --printer already opened
ERR_NO_PRINTER NUMBER := -30; --the printer driver does not exist
ERR_NO_TARGET NUMBER := -40; --no printer found (could of off, faulty, unsupported)
ERR_NO_MEMORY NUMBER := -50; --insufficient memory
ERR_HANDLE NUMBER := -60; --invalid printer ID
ERR_TIMEOUT NUMBER := -70; --time out error
ERR_ACCESS NUMBER := -80; --cannot read/write to printer (printing in progress)
ERR_PARAM NUMBER := -90; --parameter error
ERR_OFFLINE NUMBER := -110; --printer was opened in offline state. Status must be changed to online.
ERR_NOT_EPSON NUMBER := -120; --printer is not an EPSON printer
* INITIALIZE
* Initializes the interface between Forms and the EPSON library (call before any other function in the package).
* Returns:
* TRUE if the library is registered successfully,
* FALSE otherwise (library not found etc...)
function INITIALIZE return BOOLEAN;
* OPEN_PRINTER
* Obtains a handle on the specified EPSON slip printer (either CHEQUE_PRINTER or INVOICE_PRINTER).
* Returns:
* a printer ID for the specified printer (greater than 0)
* an error code on failure (less than 0):
* ERR_TYPE, ERR_OPENED, ERR_NO_PRINTER, ERR_NO_TARGET, ERR_NO_MEMORY, ERR_PARAM
function OPEN_PRINTER (p_printer_name IN VARCHAR2) return NUMBER;
* CLOSE_PRINTER
* Releases the handle on the specified printer.
* Returns:
* 0 on success
* ERR_HANDLE on failure
function CLOSE_PRINTER (p_printer_id IN NUMBER) return NUMBER;
* IS_PAPER_OUT
* Tests if there is no paper in the printer.
* Returns:
* 1 if there is no paper in the printer, 0 if paper is in the printer
* ERR_HANDLE or ERR_PARAM on failure.
function IS_PAPER_OUT (p_printer_id IN NUMBER) return NUMBER;
* PRINT_TEXT
* Prints the specified text to the specified printer.
* Returns:
* 0 on success
* ERR_HANDLE, ERR_ACCESS, ERR_OFFLINE, ERR_NOT_EPSON, or ERR_PARAM on failure.
function PRINT_TEXT (p_printer_id IN NUMBER, p_text IN VARCHAR2) return NUMBER;
* RELEASE_PAPER
* Performs the Release function on the specified printer.
* Returns:
* 0 on success
* ERR_HANDLE, ERR_ACCESS, ERR_OFFLINE, ERR_NOT_EPSON, or ERR_PARAM on failure.
function RELEASE_PAPER (p_printer_id IN NUMBER) return NUMBER;
/* PRIVATE FUNCTIONS
function BiOpenMonPrinter(arg0 in PLS_INTEGER,
arg1 in out VARCHAR2)
return PLS_INTEGER;
function BiCloseMonPrinter(arg0 in PLS_INTEGER)
return PLS_INTEGER;
function BiGetStatus(arg0 in PLS_INTEGER,
arg1 in out PLS_INTEGER)
return PLS_INTEGER;
function BiDirectIO(arg0 in PLS_INTEGER,
arg1 in PLS_INTEGER,
arg2 in out VARCHAR2,
arg3 in out PLS_INTEGER,
arg4 in out VARCHAR2,
arg5 in PLS_INTEGER,
arg6 in PLS_INTEGER)
return PLS_INTEGER;
function BiDirectIOEx(arg0 in PLS_INTEGER,
arg1 in PLS_INTEGER,
arg2 in out VARCHAR2,
arg3 in out PLS_INTEGER,
arg4 in out VARCHAR2,
arg5 in PLS_INTEGER,
arg6 in PLS_INTEGER,
arg7 in PLS_INTEGER)
return PLS_INTEGER;
END;
PACKAGE BODY EPSON_SLIP_PRINTER_INTERFACE IS
v_msg_b VARCHAR2(20);
v_EPSON_LIBRARY_OK BOOLEAN:= FALSE;
--ORA_FFI function handles and library handle
lh_EpsStmApi ora_ffi.libHandleType; --DLL library handle
fh_BiOpenMonPrinter ora_ffi.funcHandleType; --DLL function handle
fh_BiCloseMonPrinter ora_ffi.funcHandleType; --DLL function handle
fh_BiGetStatus ora_ffi.funcHandleType; --DLL function handle
fh_BiDirectIO ora_ffi.funcHandleType; --DLL function handle
fh_BiDirectIOEx ora_ffi.funcHandleType; --DLL function handle
--constant
ASB_SLIP_BOF PLS_INTEGER := 4*power(16,5); --BOF printer status flag 0x00400000
c_release_code CHAR(2) := CHR(27)||CHR(113); --ESC+q, to release the paper
-------PRIVATE FUNCTIONS--------
* Brendan Rickey 2004-JAN-09
* The following are functions that are required to interface with the
* EPSON StatusAPI DLL (C library) though ORA_FFI.
* The following describes the DLL functions that are made available
* through this ORA_FFI implementation:
Function Purpose
BiOpenMonPrinter Get a handle on a printer.
Parameters
p_Type --int: 1 if p_Name is a port, 2 if a printer name.
,p_Name --varchar2: the port of printer name to open.
Return printer identifier number (>0) on success, < 0 on failure.
BiCloseMonPrinter Close the monitor on the printer.
Parameters
p_Handle --int: The numerical printer handle returned from BiOpenMonPrinter.
Return 0 on success, < 0 on failure.
BiGetStatus Returns the status of the printer.
Parameters
p_Handle --int: The numerical printer handle returned from BiOpenMonPrinter.
,p_Status OUT --long: The status of the printer (use AND bitwise operator to test for statuses).
Return 0 on success, < 0 on failure.
BiDirectIO Sends data to and Reads data from the printer. Use BiDirectIOEx if more that 255 chars are to be written/read.
Parameters
p_Handle --int: The numerical printer handle returned from BiOpenMonPrinter.
,p_WriteLen --short: The length of the command/data being sent to the printer (max 255).
,p_WriteCmd --varchar2: The command/data to send to the printer.
,p_ReadLen --short: The length of the data to be read from the printer (max 255)
(Use 0 if no data is to be read).
,p_ReadBuff OUT --varchar2: The buffer where the the data read from the printer is stored.
,p_Timeout --long: write/read time out in msecs.
,p_NullTerminate --short: 0 => reading of data from printer is performed until time out or length of p_ReadLen is reached.
1 => reading is finished at thepoint when a NULL is received from the printer. ReadLen must have a value.
Return 0 on success, < 0 on failure.
BiDirectIOEx Sends data to and Reads data from the printer (handles larger quantities of write/read data).
Parameters
p_Handle --int: The numerical printer handle returned from BiOpenMonPrinter.
,p_WriteLen --long: The length of the command/data being sent to the printer.
,p_WriteCmd --varchar2: The command/data to send to the printer.
,p_ReadLen --long: The length of the data to be read from the printer (Use 0 if no data is to be read).
,p_ReadBuff OUT --varchar2: The buffer where the the data read from the printer is stored.
,p_Timeout --long: write/read time out in msecs.
,p_NullTerminate --short: 0 => reading of data from printer is performed until time out or length of p_ReadLen is reached.
1 => reading is finished at thepoint when a NULL is received from the printer. ReadLen must have a value.
,p_Option --short: 0 => prevents Automatic Status Back (ASB) during execution of this function (as does BiDirectIO).
1 => does not disable Automatic Status Back (ASB).
Return 0 on success, < 0 on failure.
function icd_BiOpenMonPrinter(funcHandle in ora_ffi.funcHandleType, arg0 in PLS_INTEGER,
arg1 in out VARCHAR2)
return PLS_INTEGER;
pragma interface(c, icd_BiOpenMonPrinter, 11265);
function BiOpenMonPrinter(arg0 in PLS_INTEGER,
arg1 in out VARCHAR2)
return PLS_INTEGER is
begin
return(icd_BiOpenMonPrinter(fh_BiOpenMonPrinter,
arg0,
arg1));
end;
function icd_BiCloseMonPrinter(funcHandle in ora_ffi.funcHandleType, arg0 in PLS_INTEGER)
return PLS_INTEGER;
pragma interface(c, icd_BiCloseMonPrinter, 11265);
function BiCloseMonPrinter(arg0 in PLS_INTEGER)
return PLS_INTEGER is
begin
return(icd_BiCloseMonPrinter(fh_BiCloseMonPrinter,
arg0));
end;
function icd_BiGetStatus(funcHandle in ora_ffi.funcHandleType, arg0 in PLS_INTEGER,
arg1 in out PLS_INTEGER)
return PLS_INTEGER;
pragma interface(c, icd_BiGetStatus, 11265);
function BiGetStatus(arg0 in PLS_INTEGER,
arg1 in out PLS_INTEGER)
return PLS_INTEGER is
begin
return(icd_BiGetStatus(fh_BiGetStatus,
arg0,
arg1));
end;
function icd_BiDirectIO(funcHandle in ora_ffi.funcHandleType, arg0 in PLS_INTEGER,
arg1 in PLS_INTEGER,
arg2 in out VARCHAR2,
arg3 in out PLS_INTEGER,
arg4 in out VARCHAR2,
arg5 in PLS_INTEGER,
arg6 in PLS_INTEGER)
return PLS_INTEGER;
pragma interface(c, icd_BiDirectIO, 11265);
function BiDirectIO(arg0 in PLS_INTEGER,
arg1 in PLS_INTEGER,
arg2 in out VARCHAR2,
arg3 in out PLS_INTEGER,
arg4 in out VARCHAR2,
arg5 in PLS_INTEGER,
arg6 in PLS_INTEGER)
return PLS_INTEGER is
begin
return(icd_BiDirectIO(fh_BiDirectIO,
arg0,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6));
end;
function icd_BiDirectIOEx(funcHandle in ora_ffi.funcHandleType, arg0 in PLS_INTEGER,
arg1 in PLS_INTEGER,
arg2 in out VARCHAR2,
arg3 in out PLS_INTEGER,
arg4 in out VARCHAR2,
arg5 in PLS_INTEGER,
arg6 in PLS_INTEGER,
arg7 in PLS_INTEGER)
return PLS_INTEGER;
pragma interface(c, icd_BiDirectIOEx, 11265);
function BiDirectIOEx(arg0 in PLS_INTEGER,
arg1 in PLS_INTEGER,
arg2 in out VARCHAR2,
arg3 in out PLS_INTEGER,
arg4 in out VARCHAR2,
arg5 in PLS_INTEGER,
arg6 in PLS_INTEGER,
arg7 in PLS_INTEGER)
return PLS_INTEGER is
begin
return(icd_BiDirectIOEx(fh_BiDirectIOEx,
arg0,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6,
arg7));
end;
--------PUBLIC FUNCTIONS--------
function INITIALIZE return BOOLEAN IS
BEGIN
--When this is the first package function called, code in the package's
--body is executed and sets v_EPSON_LIBRARY_OK.
RETURN v_EPSON_LIBRARY_OK;
END;
function OPEN_PRINTER (p_printer_name IN VARCHAR2) return NUMBER IS
v_printer PLS_INTEGER;
v_printer_name VARCHAR2(50) := p_printer_name;
v_name_type PLS_INTEGER := 2; --use printer Name to specify printer
BEGIN
/* Open a monitor for the printer */
v_printer := BiOpenMonPrinter(v_name_type,v_printer_name);
RETURN v_printer;
END;
function CLOSE_PRINTER (p_printer_id IN NUMBER) return NUMBER IS
v_return PLS_INTEGER;
BEGIN
/* CLOSE the printer monitor */
v_return := BiCloseMonPrinter(p_printer_id);
RETURN v_return;
END;
function IS_PAPER_OUT (p_printer_id IN NUMBER) return NUMBER IS
v_return PLS_INTEGER;
v_status PLS_INTEGER := -123456;
BEGIN
/* Test if paper is in the printer by first getting the status (a binary integer) */
v_return := BiGetStatus(p_printer_id,v_status);
IF v_return <> 0 THEN
RETURN v_return;
ELSE
--Test for BOF status flag
IF WIN_API_BITOP.BITWISE_AND(v_status,ASB_SLIP_BOF) = ASB_SLIP_BOF THEN
RETURN 1; --paper out
ELSE
RETURN 0; --paper in
END IF;
END IF;
END;
function PRINT_TEXT (p_printer_id IN NUMBER, p_text IN VARCHAR2) return NUMBER IS
v_return PLS_INTEGER;
v_text VARCHAR2(2000) := p_text;
v_text_len PLS_INTEGER; --number of characters to be printed
v_read_len PLS_INTEGER := 0; --number of characters to be read from the printer
v_read_buff VARCHAR2(255) := NULL; --not used: holds characters read from the printer
v_timeout PLS_INTEGER := 1000; --not used: amount of time to wait for response (msecs)
v_nullTerm PLS_INTEGER := 0; --not used: 0 means read until reached v_read_len or v_timeout
-- 1 means read until NULL received from printer
v_option PLS_INTEGER := 0; --0 means do not answer other requests while printing
--1 means do not stop answering other requests while printing
BEGIN
--Get the number of chars to be printed and then print.
v_text_len := length(p_text);
v_return := BiDirectIOEx(p_printer_id,
v_text_len,
v_text,
v_read_len,
v_read_buff,
v_timeout,
v_nullTerm,
v_option);
--Ignore timeout(-70) errors, otherwise return error
IF v_return = -70 THEN
v_return := 0;
END IF;
RETURN v_return;
END;
function RELEASE_PAPER (p_printer_id IN NUMBER) return NUMBER IS
BEGIN
/* Release the paper by sending the release escape code to the printer */
RETURN PRINT_TEXT(p_printer_id, c_release_code);
END;
-----END OF FUNCTION IMPLEMENTATIONS-----
BEGIN
* Load the EPSON printer driver's StatusAPI library.
* Create an ORA_FFI interface to the library by doing the following for each desired function:
* 1- Create a handle on the function,
* 2- Register the return value,
* 3- Register the arguments/parameters in the correct order.
lh_EpsStmApi := ora_ffi.load_library('', 'EpsStmApi.DLL');
IF Ora_Ffi.Is_Null_Ptr(lh_EpsStmApi) THEN
AFC_MESSAGES('I','MAIN-0020','E',v_msg_b);
v_EPSON_LIBRARY_OK := FALSE;
ELSE
fh_BiOpenMonPrinter := ora_ffi.register_function(lh_EpsStmApi, 'BiOpenMonPrinter', ora_ffi.c_std);
ora_ffi.register_return(fh_BiOpenMonPrinter, ora_ffi.c_int, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiOpenMonPrinter, ora_ffi.c_int, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiOpenMonPrinter, ora_ffi.c_char_ptr, ora_ffi.pls_varchar2);
fh_BiCloseMonPrinter := ora_ffi.register_function(lh_EpsStmApi, 'BiCloseMonPrinter', ora_ffi.c_std);
ora_ffi.register_return(fh_BiCloseMonPrinter, ora_ffi.c_int, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiCloseMonPrinter, ora_ffi.c_int, ora_ffi.pls_pls_integer);
fh_BiGetStatus := ora_ffi.register_function(lh_EpsStmApi, 'BiGetStatus', ora_ffi.c_std);
ora_ffi.register_return(fh_BiGetStatus, ora_ffi.c_int, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiGetStatus, ora_ffi.c_int, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiGetStatus, ora_ffi.c_long_ptr, ora_ffi.pls_pls_integer);
fh_BiDirectIO := ora_ffi.register_function(lh_EpsStmApi, 'BiDirectIO', ora_ffi.c_std);
ora_ffi.register_return(fh_BiDirectIO, ora_ffi.c_int, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiDirectIO, ora_ffi.c_int, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiDirectIO, ora_ffi.c_short, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiDirectIO, ora_ffi.c_char_ptr, ora_ffi.pls_varchar2);
ora_ffi.register_parameter(fh_BiDirectIO, ora_ffi.c_short_ptr, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiDirectIO, ora_ffi.c_char_ptr, ora_ffi.pls_varchar2);
ora_ffi.register_parameter(fh_BiDirectIO, ora_ffi.c_long, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiDirectIO, ora_ffi.c_short, ora_ffi.pls_pls_integer);
fh_BiDirectIOEx := ora_ffi.register_function(lh_EpsStmApi, 'BiDirectIOEx', ora_ffi.c_std);
ora_ffi.register_return(fh_BiDirectIOEx, ora_ffi.c_int, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiDirectIOEx, ora_ffi.c_int, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiDirectIOEx, ora_ffi.c_long, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiDirectIOEx, ora_ffi.c_char_ptr, ora_ffi.pls_varchar2);
ora_ffi.register_parameter(fh_BiDirectIOEx, ora_ffi.c_long_ptr, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiDirectIOEx, ora_ffi.c_char_ptr, ora_ffi.pls_varchar2);
ora_ffi.register_parameter(fh_BiDirectIOEx, ora_ffi.c_long, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiDirectIOEx, ora_ffi.c_short, ora_ffi.pls_pls_integer);
ora_ffi.register_parameter(fh_BiDirectIOEx, ora_ffi.c_short, ora_ffi.pls_pls_integer);
v_EPSON_LIBRARY_OK := TRUE;
END IF;
EXCEPTION
WHEN OTHERS THEN
AFC_MESSAGES('I','MAIN-0021','E',v_msg_b);
v_EPSON_LIBRARY_OK := FALSE;
END;Hi Duncan,
Thanks for the response. Beyond the problem you pointed out I found that the "open server" command is requiring a window handle parameter, even though it isn't used by the program. I talked with Oracle Support and it turns out that even if the window handle isn't used, it's existence makes it not work with the current version of webutil.
The program I am working with also has a COM interface, so I decided to back up and redo the interface using webutil OLE2. I've got it working now, just a little more polishing to do.
Thanks again for the help.
Mark -
ORA_FFI ----- WebUtil_C_API
Does anyone have a working example for me, or even better , point me in the direction of some decent documentation.
Thanks
GrahamHi All,
I am currently working with Oracle Forms 6i and I am wanting to call a the Crystal Reports Print Engine DLL.
From my understanding WebUtil is for Oracle Forms 9i and doesn't work with Forms 6i. I tried to load the PLL but it failed.
My understanding of ORA_FFI is minimal, but most of the discussions center around using this to call a DLL from Forms in PL/SQL.
Is ORA_FFI part of the database set of packages when it is installed or is it something that has to be run manually from a SQL script?
Also is there any good documentation on ORA_FFI and does it still exist?
I have found an example which I obtained off the Business Objects website, but it fails in loading the DLL.
Has anybody had any similar problems and how did they resolve them?
Any help in this area would be much appreciated.
Thanks,
Scott. -
Hi all
I would know the current directory in my application with the employement of ora_ffi and I meet some problem like the return code not give the good result.
I have whrite this code and I would know where is the error :
PACKAGE BODY pkg_get_directory IS
Libdirectory_lhandle Ora_Ffi.Libhandletype ;
to_dir_fhandle Ora_Ffi.Funchandletype ;
FUNCTION ff_to_dir(fhandle Ora_Ffi.Funchandletype,bufsz in number,lppath in out varchar2) RETURN NUMBER;
PRAGMA interface(C, ff_to_dir, 11265);
FUNCTION GetCurrentDirectory(bufsz in out number,lppath in out varchar2) RETURN NUMBER IS
BEGIN
RETURN(ff_to_dir(to_dir_fhandle,bufsz,lppath));
END GetCurrentDirectory;
BEGIN
Libdirectory_lhandle := Ora_Ffi.Load_Library('C:\WINNT\SYSTEM32\','KERNEL32.dll');
to_dir_fhandle := Ora_Ffi.Register_Function(Libdirectory_lhandle, 'GetCurrentDirectoryW', Ora_Ffi.C_Std);
Ora_Ffi.Register_Parameter(to_dir_fhandle, Ora_Ffi.C_DOUBLE_PTR);
Ora_Ffi.Register_Parameter(to_dir_fhandle, Ora_Ffi.C_CHAR_PTR);
Ora_Ffi.Register_Return(to_dir_fhandle, Ora_Ffi.C_DOUBLE);
END;Noticed that I forgot to include the error. It comes from the "message" call I put in the exception block and reads:
'Failure func_31_param: p31. Fatal Error: 304500: non-ORACLE exception'
That 304500 isn't particularly informative. I've seen other posts of people getting this exception from ora_ffi.load_library -
Webutil, ora_ffi and source code
Hi
We use forms 6i, so, of course, we can't use webutil.
What we currently do in client/server is use the get_file_name to allow the user to select a file from their drives and then that path and filename are stored in the database.
Then, using some ORA_FFI code, we allow the user to click on the file name and the file opens on their machine, using the default application (done by a call to shellexecutea, I think)
ANYHOW, what we'd like to do is bring this over into our web deployment.
For the get_file_name item, I was thinking that if we could get the source code for Webutil, we could make it work for 6i.
Question: Is there any place I can get the source?
For the opening of the file, it gets a little more complicated.
Question: Does anyone know how I might accomplish the same functionality for our web as we have on our client/server version?
(yeah, I know this is kind of a big question)
thanks!
-JoelHI Joel,
As far as I saw,you can use webutil with F6i...the only requirement is to have a JInitiator 1.3.1.9 available..
You can download it from otn and install it into Forms6i..
I don't know exactly ,but it seems to me that patch 13 installs it automatically..
You can open the webutil.pll with a text editor and get the code frm there,and create the 6i pll.
And with webutil.olb,you can open it in a forms9i get the code from the triggers on the block,and create a 6i olb file.
I thinck it worth the work.
You must also create the virtual directory where the webutil files are downloaded from.
Good luck -
Doubt in ORA_FFI(Its urgent)
Hi,
I've created a test.dll which contains caps func as follows:
int caps()
int * ptr=0x417;
if (*ptr==64)
return 1;
else
return 0;
Then I called this func through ORA_FFI package..
DECLARE
dll_handle ORA_FFI.LIBHANDLETYPE;
winexec_handle ORA_FFI.FUNCHANDLETYPE;
vn_ret PLS_INTEGER;
FUNCTION Runp( handle IN ORA_FFI.FUNCHANDLETYPE)
RETURN PLS_INTEGER;
PRAGMA INTERFACE(C, Runp, 11265);
BEGIN
break;
dll_handle := ORA_FFI.REGISTER_LIBRARY(NULL,'test.dll');
winexec_handle := ORA_FFI.REGISTER_FUNCTION(dll_handle,'caps');
ORA_FFI.REGISTER_RETURN(winexec_handle,ORA_FFI.C_INT);
vn_ret := Runp(winexec_handle);
IF vn_ret = 2 THEN
MESSAGE('Cannot find file ' );
END IF;
EXCEPTION WHEN OTHERS THEN
FOR i IN 1..Tool_Err.NErrors LOOP
message(Tool_Err.Message);
Tool_Err.Pop;
END LOOP;
END;
When I debug this code,It gives error as caps func not found in test.dll.
But the only func in test.dll is caps..
I'm using forms 6i in client server mode.
I created test.dll using Microsoft visual c++ by creating new win32 Dynamic link library.
One more doubt:
How can I find functions in a already compiled DLL?
Pls reply me..Its urgent..
Adios..
Prashanth DeshmukhHi,
refer these ,u will get some help
Standard Buttons:
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/webDynproABAP-ALVControllingStandard+Buttons&
alv-pfstatus:
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_pfstatus.htm
then how to capture that button click.
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_ucomm.htm
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_rowsel.htm -
Error using ORA_FFI.REGISTER_PARAMETER
Hi all ,
I am using forms 11gr2.
I an using ORA_FFI built-in in my code.
I am able to load library and register a function.
I am also able to register the parameters if the number of parameters is less than 30.
The code is working fine in 6i.
if i am having more than 30 calls to ORA_FFI.REGISTER_PARAMETER I am getting ORA-304500 error.
What could be the3 possible reason of this
Please help,
Thanks.Noticed that I forgot to include the error. It comes from the "message" call I put in the exception block and reads:
'Failure func_31_param: p31. Fatal Error: 304500: non-ORACLE exception'
That 304500 isn't particularly informative. I've seen other posts of people getting this exception from ora_ffi.load_library -
Will DDE, ORA_FFI & OLE2 packages work in Forms 10g
Hi All,
Will the function's and procedure's of the packages DDE, ORA_FFI and OLE2 work in Oracle Forms 10g, when running the forms as Client-Server (Two Tier).
Regards,
Prasad.when running the forms as Client-Server (Two Tier).You cannot run Forms 10g client/server, only as a web application.
The packages still work, but you must use the CLIENT_... version from webutil if you want to call something on the client. -
I'm not familait with 'ORA_FFI' can someone give hi-level highlights of the 3 main functions and what do they do (ORA_FFI.LOAD_LIBRARY,ORA_FFI.REGISTER_FUNCTION,ORA_FFI.REGISTER_PARAMETER)
Also a link for more details will be appreciated
“ libhandle := ORA_FFI.LOAD_LIBRARY(dirname, libname);
funchandle := ORA_FFI.REGISTER_FUNCTION(libhandle,'purchase',ORA_FFI.C_STD);
ORA_FFI.REGISTER_PARAMETER(funchandle,ORA_FFI.C_CHAR_PTR); --id
ORA_FFI.REGISTER_PARAMETER(funchandle,ORA_FFI.C_CHAR_PTR); --plan
ORA_FFI.REGISTER_PARAMETER(funchandle,ORA_FFI.C_CHAR_PTR); --v3careercreatedate
ORA_FFI.REGISTER_PARAMETER(funchandle,ORA_FFI.C_CHAR_PTR); --jurisdiction
ORA_FFI.REGISTER_PARAMETER(funchandle,ORA_FFI.C_CHAR_PTR); --membertype
ORA_FFI.REGISTER_PARAMETER(funchandle,ORA_FFI.C_CHAR_PTR); --transdate
ORA_FFI.REGISTER_PARAMETER(funchandle,ORA_FFI.C_INT_PTR); --warning
ORA_FFI.REGISTER_PARAMETER(funchandle,ORA_FFI.C_CHAR_PTR); --warningmsg
ORA_FFI.REGISTER_PARAMETER(funchandle,ORA_FFI.C_INT_PTR); --error
ORA_FFI.REGISTER_PARAMETER(funchandle,ORA_FFI.C_CHAR_PTR); --msg
“I found a link
http://www.oracle.com/webapps/online-help/reports/10.1.2/state/content/navId.3/navSetId._/vtTopicFile.htmlhelp_rwbuild_hs%7Crwrefex%7Cplsql%7Cbuiltins%7Coraffi%7Cpkg_ffi%7Ehtm/ -
Using ora_ffi to run window application
Does anyone know how to use ora_ffi package to call a window
application? ( I did not use host command because I wish to go
back to the calling form. ) Thanks.
nullcan write without a package too, in a trigger. This code is with error checking
DECLARE
dll_handle ORA_FFI.LIBHANDLETYPE;
winexec_handle ORA_FFI.FUNCHANDLETYPE;
vn_ret PLS_INTEGER;
FUNCTION Runp( handle IN ORA_FFI.FUNCHANDLETYPE,
cmd IN OUT VARCHAR2,
disp_mode IN PLS_INTEGER)
RETURN PLS_INTEGER;
PRAGMA INTERFACE(C, Runp, 11265);
BEGIN
dll_handle := ORA_FFI.REGISTER_LIBRARY(NULL,'kernel32.dll');
winexec_handle := ORA_FFI.REGISTER_FUNCTION(dll_handle,'WinExec');
ORA_FFI.REGISTER_RETURN(winexec_handle,ORA_FFI.C_INT);
ORA_FFI.REGISTER_PARAMETER(winexec_handle,ORA_FFI.C_CHAR_PTR);
ORA_FFI.REGISTER_PARAMETER(winexec_handle,ORA_FFI.C_INT);
vn_ret := Runp(winexec_handle,:control.path ,1);
IF vn_ret = 2 THEN
MESSAGE('Cannot find file ' | | :control.path);
END IF;
EXCEPTION WHEN OTHERS THEN
FOR i IN 1..Tool_Err.NErrors LOOP
message(Tool_Err.Message);
Tool_Err.Pop;
END LOOP;
END; -
I have a need to use the client/server forms6i to access a Check encoder machine made by Maverick International. They provide a dll for using their code. Has anyone implemented this successfully anywhere using Oracle Forms 4.5 or 6i?
If not does anyone have experience implementing the ora_ffi who could guide me through some C code to assist in getting this done?Basically you need to:
1. Register in .pll file (library) all the programs you are using from the dll.
You can find examples in the Forms help topics ( search for ORA_FFI ).
2. Attach the .pll in the form where you are using this dll. -
ORA_FFI.LOAD_LIBRARY
Dear Oracle friends
I'm new to using of ORA_FFI package
I have a code which is doind an open ORA_FFI.LOAD_LIBRARY the name and path are ok
I'm getting ORA-304500 ?? please help ??
ThanksORA_FFI is a Forms library. Consequently you would be better off asking the question in Forms.
Cheers, APC
blog: http://radiofreetooting.blogspot.com -
ORA_FFI problem in using JNI from C dll
Hi,
I am encountering a strange problem in ORA_FFI while calling a C dll.
The C program uses JNI to dynamically load a jvm (using LoadLibrary('C:\\jdev1012\\jdk\\jre\\bin\\server\\jvm.dll'))and then call an
instance object. The problem is when invoked at runtime it executes
fine the first time but from the same session if its invoked again the
JVM fails to initialize. It seems the JVM is not getting released though
I am using DestroyJavaVM.
I am using forms10g and could have used ORA_JAVA but i have some
other C projects with which i am trying to integrate into one dll.
I am really stuck and any experience on this will really be helpful.
-Thanks,
SamratI suspect the "-d64" switch is interpreted by the java launcher to make it load a 64-bit JVM library rather than one of the the usual 32-bit JVM libraries. If so, you would need to load the same 64-bit JVM in your own program. Try looking in SDK source files java.c and java_md.c to get started.
(I don't have HP-UX or any 64-bit system here, so this is just a best guess.)
-slj- -
Urgent: How to use ORA_FFI to call exe program from Report 6i
We follow report help to use ORA_FFI but it does not work. Kindly help to advise sample code for using it.
Stevenu can solve this problem with lexical parameter.
create a user parameter and use it as lexcical parameter.
create a ur on form with form builder instead of report default parameter form and run reprport with parameters.
here is an exmple that i used.
if :Month is not null and :year is not null and :sjnl_no is not null then
declare
plist paramlist;
begin
plist := get_parameter_list ('list_1');
if not id_null(plist) then
destroy_parameter_list (plist);
end if;
plist := create_parameter_list ('list_1');
add_parameter (plist, 'P_where', text_parameter,'and (doc_no='||:SJNL_NO||')and to_char(doc_date,''MON-YYYY'')='''||:MONTH||'-'||:Year||'''');
add_parameter (plist, 'DESTYPE', text_parameter,:des_type);
run_product(REPORTS,'sale_journal', SYNCHRONOUS, RUNTIME, FILESYSTEM, plist);
exit_form;
end;
else
Message ('Select Moth, Year and Document No. first.');
end if;
Qadeer -
Forms 11g: limit of 30 calls to ora_ffi.register_function
Converting from Forms 10.2 to Forms 11.1.2 (and a 10g App Server to WebLogic 10.3.5) encountering a problem with ORA_FFI references to functions that have more than 30 parameters.
The 31st call to ora_ffi.register_parameter for a function always fails.
The code snippet below is from a sample I built to illustrate the problem to someone else. We have a similar library in our production code that registers many functions. Some of the functions have more than 30 paramteres some have less. No matter what order I register the functions in, the failiure always occurs in the first function to have a 31st parameter registered against it. All functions with 30 or fewer parameters register just fine.
no problems loading the library of registering the first function, the return, or the parameters (only 3 parameters)
also can register the second function, the return, and the first 30 parameters
<pre>
PACKAGE BODY TEST_FFI IS
dbug_msg VARCHAR2(100);
dll_loaded boolean := false;
lh_dll_handle ORA_FFI.LIBHANDLETYPE;
fh_short_list ORA_FFI.FUNCHANDLETYPE;
fh_long_list ORA_FFI.FUNCHANDLETYPE;
PROCEDURE init_ffi IS
BEGIN
if (dll_loaded) then
message('success');
else
message('fail');
end if;
END init_ffi;
BEGIN
dbug_msg := 'load liboraffi.so';
lh_dll_handle := ora_ffi.load_library (null, 'liboraffi.so');
-- 3 Parameters
dbug_msg := 'func_3_param: function';
fh_short_list := ora_ffi.register_function (lh_dll_handle, 'func_3_param', ora_ffi.C_STD);
dbug_msg := 'func_3_param: return';
ora_ffi.register_return(fh_short_list, ora_ffi.c_long);
dbug_msg := 'func_3_param: p1';
ora_ffi.register_parameter(fh_short_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_3_param: p2';
ora_ffi.register_parameter(fh_short_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_3_param: p3';
ora_ffi.register_parameter(fh_short_list, ora_ffi.c_char_ptr);
-- 31 Parameters
dbug_msg := 'func_31_param: function';
fh_long_list := ora_ffi.register_function (lh_dll_handle, 'func_31_param', ora_ffi.C_STD);
dbug_msg := 'func_31_param: return';
ora_ffi.register_return(fh_long_list, ora_ffi.c_long);
dbug_msg := 'func_31_param: p1';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p2';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p3';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p4';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p5';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p6';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p7';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p8';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p9';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p10';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p11';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p12';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p13';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p14';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p15';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p16';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p17';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p18';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p19';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p20';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p21';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p22';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p23';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p24';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p25';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p26';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p27';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p28';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p29';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p30';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dbug_msg := 'func_31_param: p31';
ora_ffi.register_parameter(fh_long_list, ora_ffi.c_char_ptr);
dll_loaded := true;
EXCEPTION
WHEN OTHERS THEN
message ('Failure ' || dbug_msg || '. Fatal Error: ' || sqlerrm);
dll_loaded := false;
raise;
END test_ffi;
</pre>Noticed that I forgot to include the error. It comes from the "message" call I put in the exception block and reads:
'Failure func_31_param: p31. Fatal Error: 304500: non-ORACLE exception'
That 304500 isn't particularly informative. I've seen other posts of people getting this exception from ora_ffi.load_library
Maybe you are looking for
-
My 4th Gen Ipod touch will not get past the apple logo
My 4th Gen Ipod touch will not get past the apple logo (unless the battery is dead, Then it tell me to charge it). Once it gave me the connect to itunes screen. I clicked restore in itunes but the ipod went back to the apple logo before the update
-
it is september 30 ,(end of sept) as they promised they said that they will make sure that Amber update reaches every lumia phone's but lumia 620 didnt receive any update upto now, its very disappointing.the update is much awaitied phone has lot of p
-
My iPad used to ask for an ID before purchasing apps or in app purchases. Now after I buy one thing other apps can be added without my ID. Young kids play on this iPad and I have to make it Impossible for them to make purchases. I don't know how to
-
Hi ABAPers, I am working one GRNSTATUS report.In which based on DELINS (Delins GUID) i want to find Purchase order/Purchase order Guid.If any one having idea about this Could you please guide me. Thanks in Advance, regards, kishore.
-
Column limits for Crystal Reports for Eclipse
Hi , Is there any column limits for Crystal Reports for Eclipse. While i am trying in my environment, if i am include more than 18 columns its wont show the preview as well as it throws error like as follows "java.lang.NullPointerException at sun.mis