-
Hi all,
I wanted to use the Messagebox function in my form ...so how do i do it....
what i have tried is creating a package which is as follows....
PACKAGE messagebox IS
/*Function message_box calls windows MessageBox function. */
FUNCTION message_box(plptext IN VARCHAR2,plpcaption IN VARCHAR2,punit IN PLS_INTEGER)
RETURN PLS_INTEGER;
END;
--------------------------------------------------------------------
PACKAGE BODY messagebox IS
lh_window ORA_FFI.LIBHANDLETYPE;
fh_mb ORA_FFI.FUNCHANDLETYPE;
/* Function i_mbx acts as the interface to the Messagebox
function in windows
*/
FUNCTION i_mbx(funcHandle IN ORA_FFI.FUNCHANDLETYPE,
plptext IN OUT VARCHAR2,
plpcaption IN OUT VARCHAR2,
punit IN OUT PLS_INTEGER)
RETURN PLS_INTEGER;
PRAGMA interface(C,i_mbx,11265);
FUNCTION message_box(plptext IN VARCHAR2,
plpcaption IN VARCHAR2,
punit IN PLS_INTEGER)
RETURN PLS_INTEGER IS
ltext VARCHAR2(500) := plptext;
lcaption VARCHAR2(500) := plpcaption;
lpunit PLS_INTEGER(500) := punit;
BEGIN
RETURN(i_mbx(fh_mb,ltext,lcaption,lpunit));
END;
BEGIN
/* Declare a library handle to windows 386 kernal */
lh_window := ORA_FFI.LOAD_LIBRARY(NULL,'c:\system32\krnl386.exe');
fh_mb := ORA_FFI.REGISTER_FUNCTION(lh_window,'MessageBox',ORA_FFI.PASCAL_STD);
ORA_FFI.REGISTER_RETURN(fh_mb,ORA_FFI.C_CHAR_PTR);
ORA_FFI.REGISTER_RETURN(fh_mb,ORA_FFI.C_CHAR_PTR);
ORA_FFI.REGISTER_RETURN(fh_mb,ORA_FFI.C_INT);
END;
--------------------------------------------------------------------
But when i call this function messagebox.message_box(***) in my form and run the form i get and error:
Error:FRM-40735:WHEN-MOUSE-CLICK trigger raised unhandled exception ORA-304500.
Can anybody tutor me ... where have i gone wrong...
thank you
Ramadas
-
Moved thread
Dear Ramdass, 6th Aug 2001 20:58 hrs chennai
By mistake you have posetd your problem in "How to Forum"
instaed of "Oracle Database Administration" forum.
Cheers
Padmam
Attitude:Attack every problem with enthusiasam ...as if your survival depends upon it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|