[DLL]: Can I declare a global variable in a DLL?
-
Can I declare a global variable in a DLL? My variable is a object of Internal class that NOT exported. Also my global object will use internally. My dll is a "Regular DLL with MFC statically linked". Does it cause a problem?
-
Can I declare a global variable in a DLL? My variable is a object of Internal class that NOT exported. Also my global object will use internally. My dll is a "Regular DLL with MFC statically linked". Does it cause a problem?
Behzad Ebrahimi wrote: Can I declare a global variable in a DLL? Yes.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
-
Behzad Ebrahimi wrote: Can I declare a global variable in a DLL? Yes.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
But How Mr David ----------------------------- "I Think It Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk
-
But How Mr David ----------------------------- "I Think It Will Help" ----------------------------- Alok Gupta visit me at http://www.thisisalok.tk
The same way you would in an EXE. If the variable is not within the scope of a function, it has file scope, thus it is global. If you want to use the variable in a different file from which it is declared, you'll need to
extern
it.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen