Re: ORA_FFI help please!
Date: 1996/09/23
Message-ID: <3246BC78.2E23_at_vip.cybercity.dk>#1/1
Mark Daynes wrote:
>
> Help,
>
> I'm using ORA_FFI to call functions in a 3rd party DLL. Everything is
> fine until I call a function that requires a parameter to be of type
> LPSTR (Long Pointer to a string). I keep getting an error returned from
> the function indicating that the item I passed in was not recognised, so
> I rang Oracle support who told me that I can pass in char pointer and
> long integers, but not LPSTR.
>
> Oh help. Has anyone managed to achieve *ANYTHING* like this? My
> function declaration declares that parameter as C_CHAR_PTR but nothing
> seems to work. Is this just one of those unsupported things or is there
> a workaround?
>
> Thanks in anticipation.
>
> Regards
> Mark Daynes
> Plural Heaven Ltd
> www.pheaven.demon.co.uk
Hi.
Of course it will work. LPSTR is just a plain char pointer. Be aware that you need to declare the varchar2 parameter as "in out" or else you can run into trouble. Also note that a null varchar2 string is treated different from a varchar2 with contents. Use the foreign call assistant to generate the code if in doubt and remember to check "pre-allocated" and give a size in bytes for the char pointer parameter.
Hope this helps.
Ciao,
Finn
-- -------------------------------------------------------------------------------- Finn Ellebaek Nielsen Oracle Associated Senior Consultant E-mail: ellebuk_at_vip.cybercity.dk Ellebaek Consulting Mob. Phone: +45 20 32 49 25 Niels Ebbesens Vej 9, 3. th. Mob. Phone SMS: 20324925_at_sms.tdm.dk DK-1911 Frederiksberg C Private Phone: +45 33 25 34 50 Denmark -------------------------------------------------------------------------------- "Life is a beach and then you dive" "Divers do it deeper"Received on Mon Sep 23 1996 - 00:00:00 CEST