ORA_FFI ->API(FindFirstFile)
Date: 1997/06/23
Message-ID: <01bc7fd7$275661c0$8c8765c1_at_dpoweleit.horn-goerwitz.de>#1/1
Is there someone out there who has some experiences with ORA-FFI and
API-Calls?
I want to read some files from a directory. To do that I wrote the
following code in Forms 4.5 under win95:
The package body and specification compiles with no errors.
But running this way
:block.field := directory.getfirstfile('C:\DIR\*.*');
let my program crash this way
F45DBG32 verursachte einen Fehler durch eine ungültige Seite
in Modul <Unbekannt> bei 0000:01bbd132.
Register:
EAX=012f33a0 CS=0137 EIP=01bbd132 EFLGS=00010246 EBX=012f33a0 SS=013f ESP=010be6b4 EBP=010be8d8 ECX=00000000 DS=013f ESI=012f33a0 FS=2ddf EDX=00000002 ES=013f EDI=012f33a0 GS=0000Bytes bei CS:EIP:
Stapelwerte:
0095ce18 012f33a0 00f417d8 00f3c148 00ebc2ac 012f33a0 00000010 00000010
010be708 00000002 00ea20c8 00000003 00000010 00f414f8 00f414e8 00000000
some ideas, how to help me? let me know!
PACKAGE BODY DIRECTORY IS
lh ORA_FFI.LIBHANDLETYPE := ORA_FFI.Register_Library('','kernel32');
f3 ORA_FFI.FUNCHANDLETYPE :=
ORA_FFI.Register_Function(lh,'FindFirstFileA',ORA_FFI.PASCAL_STD);
[Quoted] FUNCTION icd_FindFirstFile(fh IN ORA_FFI.FUNCHANDLETYPE,
lpFileName IN OUT VARCHAR2, dwFileAttribute IN OUT PLS_INTEGER, dwCreationTimeL IN OUT PLS_INTEGER, dwCreationTimeH IN OUT PLS_INTEGER, dwLastAccessL IN OUT PLS_INTEGER, dwLastAccessH IN OUT PLS_INTEGER, dwLastWriteL IN OUT PLS_INTEGER, dwLastWriteH IN OUT PLS_INTEGER, nFileSizeH IN OUT PLS_INTEGER, nFileSizeL IN OUT PLS_INTEGER, dwReserved0 IN OUT PLS_INTEGER, dwReserved1 IN OUT PLS_INTEGER, cFileName IN OUT VARCHAR2, cAlternate IN OUT VARCHAR2)
RETURN PLS_INTEGER;
PRAGMA interface (c, icd_FindFirstFile, 11265);
FUNCTION getfirstfile(dir_name IN VARCHAR2) RETURN VARCHAR2 IS lpFileName VARCHAR2(255) := dir_name;
dwFileAttribute PLS_INTEGER;
dwCreationTimeL PLS_INTEGER;
dwCreationTimeH PLS_INTEGER;
dwLastAccessL PLS_INTEGER;
dwLastAccessH PLS_INTEGER;
dwLastWriteL PLS_INTEGER;
dwLastWriteH PLS_INTEGER;
nFileSizeH PLS_INTEGER;
nFileSizeL PLS_INTEGER;
dwReserved0 PLS_INTEGER;
dwReserved1 PLS_INTEGER;
cFileName VARCHAR2(260);
cAlternate VARCHAR2(14);
retlen PLS_INTEGER;
BEGIN
retlen := icd_FindFirstFile(f3,
lpFileName,
dwFileAttribute,
dwCreationTimeL,
dwCreationTimeH,
dwLastAccessL,
dwLastAccessH,
dwLastWriteL,
dwLastWriteH,
nFileSizeH,
nFileSizeL,
dwReserved0,
dwReserved1,
cFileName,
cAlternate);
RETURN(cFileName);
END; BEGIN
ORA_FFI.Register_Return(f3,ORA_FFI.C_INT); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_CHAR_PTR); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_INT); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_INT); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_INT); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_INT); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_INT); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_INT); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_INT); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_INT); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_INT); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_INT); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_INT); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_CHAR_PTR); ORA_FFI.Register_Parameter(f3,ORA_FFI.C_CHAR_PTR);END;
-- Daniel Poweleit from Berlin GermanyReceived on Mon Jun 23 1997 - 00:00:00 CEST
