Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> PL/SQL: Calling external C-functions in DLLs with struct as parameters
Hi all PL/SQL Gurus !
Is it possible to call external functions in a DLL written in C which has pointers to C-structs as parameter? Can you point me to an example or extended documentation about this?
I had a look at the Oracle doc's but found no examples about structs. There is someting mentioned like "INDICATOR [{STRUCT | TDO }]" but I couldn't figure out how this is related to a C-struct.
The DLL I'm trying to use is part of a function library we use in our normal programming. Now somebody came up with the idea to incorporate this functionality into the database (Oracle8i 8.1.7.0.0 on W2K-SP2). This library is from an external vendor, so we have no access to the source code. However we could write a C-function wrapper DLL if this would be neccessary. I included an example of one of the structs (typVertrag) which is passed as second parameter to a function named "BerechneVertrag". Another problem is that some functions get a pointer to a function for debugging purposes. So I think I won't get arround writing this wrapper DLL....
Any help is welcome
Stefan.
/* type definitions */
typedef struct {
long lDatum; double dRate1; double dRate2; double dRate3; double dRate4; } typRaten; typedef struct { long lDatum; double dZins; } typZins; typedef struct { char sVertragNr[8]; double dBetragDM; double dBetragEUR; ... typRaten *Raten; typZins *Zins; ... } typVertrag;
/* Function prototype, pointer to C-struct typVertrag is passed as 2.
param */
DllExport short BerechneVertrag(int, void*, int, DEBUG_FCT*);
Received on Sat Nov 24 2001 - 05:00:04 CST