Hi
I want to use a DLL, in which Functions require as parameter and yield pointers to a certain structure.
Let's say I have a library header:
struct StructType
{
int a;
void* p;
};
extern _declspec(dllimport) StructType* Func(StructType*,bool);
I want to PB-write something like this:
declare pointer here as p
p = Func(p, true)
I dont care about the contents of the struct. I want to treat a pointer to that structure type as ... a long value or something like that.
How do I declare an external function for this?
A follow-up:
In the struct I actually have the following types:
struct StructType
{
size_t a; // 32 bit or maybe 64 bit
char name[MAX_CHARS];
SomeEnumType type;
};
How do I translate these types into PB types?
I see this:
http://infocenter-archive.sybase.com/help/index.jsp?topic=/com.sybase.dc37781_1150/html/psref/BCGEGBDD.htm
and would translate it into
UnsignedInteger a;
Blob name; // ??? or : char name [1000]; ?
integer type;
Is that correct?
I tried the listed and got a bad runtime function reference error.
A call to a function in the same DLL without parameters or return type succeeded.
A call to a function with extern _declspec(dllimport) StructType* Func();
succeeded when I declared it as:
FUNCTION long Func() LIBRARY "mydll.dll"
At least I got a long value back that smelled like a valid pointer