There is an existing API function which does only allow the plugin(DLL) to receive three parameters and perform some action:
int ProcessMe(int nCommand, unsi
Place the variables to modify in a struct and pass the pointer to the sturuct to the plug in:
struct MyStruct
{
BOOL bSave;
int nOption;
};
int ProcessMe(int nCommand, unsigned int wParam, long lParam)
{
((MyStruct*)lParam)->nOption = ...;
return 0;
}
Use it like this:
int main()
{
MyStruct struct;
struct.bSave = TRUE;
struct.nOption = 0;
ProcessMe(0, 0, (long)(&struct));
if(FALSE==struct.bSave)
printf("bSave is modified!");
return 1;
}
Strictly speaking this is undefined behavior. You need to check, whether it works on your platform.
Note: I used a struct here, because this way you can also pass more variables or larger variables such as double to the function.