10-01-2007 04:15 AM
10-01-2007 06:38 AM
Try the following:
JR
10-01-2007 08:56 AM
10-01-2007 09:17 AM
10-01-2007 09:42 AM
10-02-2007 10:03 AM
Can you modify the function you are calling to take the structure as an argument?
If so, you can pass the structure into the function.
Example:
typedef struct
{
int a;
int b;
}TestStruct;
//calling program
TestStruct Obj;
TestFunc(&Obj, other args);
//dll
void TestFunc(TestStruct *Obj, other args)
{
//fill in data
}
If you are not sure how many objects you are going to get you need to pass a pointer to the dll and allocate the memory in the dll.
Example:
TestStruct *Obj;
TestFunc(&Obj, other args);
//dll
void TestFunc(TestStruct **Obj, other args)
{
(*Obj) = calloc(num of objects, sizeof(TestFunc))
(*Obj)[i].a = 5;
(*Obj)[i].b = 6;
}
10-02-2007 11:34 AM