G
Guest
Functions exported in C++ and global variables;
Hello,
I'm working with a DLL project in VISUAL C++ that exports one function with
the sentence
__declspec(dllexport). The problem is that this function returns the value
of a dll global
variable, but in fact the application that imports this functions from the
dll only see the
initial value of the global variable of the dll, but it doesn't remark
changes of value in this global
variable.
// This is an example of an exported function.
IMPORTINGDLL_API int fnProvadll(void)
{
return xavi;
}
//and the global variable in the DLL is defined like this:
int xavi=0;
What could be the problem? Please some advice from you will be useful!
Thanks all people!
Sincerely,
javitobcn
Hello,
I'm working with a DLL project in VISUAL C++ that exports one function with
the sentence
__declspec(dllexport). The problem is that this function returns the value
of a dll global
variable, but in fact the application that imports this functions from the
dll only see the
initial value of the global variable of the dll, but it doesn't remark
changes of value in this global
variable.
// This is an example of an exported function.
IMPORTINGDLL_API int fnProvadll(void)
{
return xavi;
}
//and the global variable in the DLL is defined like this:
int xavi=0;
What could be the problem? Please some advice from you will be useful!
Thanks all people!
Sincerely,
javitobcn