I want to pass several data to a Dll function, so I am thinking of creating a struct and passing them to Dll dunction via a struct such as follow:
struct options
{
int op1,
int op2,
int op3,
char * op4,
...
char * op10
}
void dllFunction(options myOptions)
As the dll should be implemented in a way that works on windows platform irrespective of what is the development tools is it, I am wondering :
Is it valid to send data in this way? note that the structure members all are basic c types (int, float, double, ...).
Why I am worried about it? as you know, different compilers implemented std classes differently, so you can not pass std classes over dll boundaries, but I am not sure if all of the compilers are placing struct members in the same way or they are not, as if they are not, then the code may not work with some compilers.
is a struct is a simple c type data type?
If I can not use a struct for this purpose, what is the best way to do this (passing a lot of data to a function inside a dll function?