You can also use memblocks to reduce the number of functions needed for large structures with IanM's idea (which is good for small number of members).
For example your DLL code:
//No byte alignment in MS VC
#pragma pack(push, 1)
typedef struct {
float X;
float Y;
DWORD Flags;
} temp_t;
void SomeFunction (DWORD MemblockPtr) {
temp_t* pExport = (type_t *) MemblockPtr;
pExport->X = -109.0;
pExport->Y = 238.1;
pExportFlags = 7;
}
and your DB code to use this:
make memblock 1, 64 ;Big enough for your data
SomeFunction(get memblock ptr(1))
X = memblock float(0)
Y = memblock float(4)
Flags = memblock DWORD(8)
You do need to make sure the C compiler doesn't change your structure size which can happen if you use bytes or words (which is what the pragma pack does with MSVC, other compilers will have a similar command). It can also be tricky to properly unpack the memblock in DB, but you only have to do it once so it's no too bad.