I'm not sure what the variables in question are. There may be a better way to do what you are doing. Generally, global is evil when it comes to variables, and this is especially true across DLL boundaries.