Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> PL/SQL: Calling external C-functions in DLLs with struct as parameters

PL/SQL: Calling external C-functions in DLLs with struct as parameters

From: Stefan Misch <stefan.misch_at_gmx.de>
Date: 24 Nov 2001 03:00:04 -0800
Message-ID: <acab6080.0111240300.1f8a2826@posting.google.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US