afxloadlibrary
-
afxloadlibrary doesn't want to compile in my program. I'm writing and MFC app, and if I compile with the line: hLibrary = AfxLoadLibrary(pathtodll); I get a compiler error that AfxLoadLibrary is an undeclared identifier. If I use the global namespace, like so: hLibrary = ::AfxLoadLibrary(pathtodll); I get the error that AfxLoadLibrary isn't a member of the global namespace. The documentation says that AfxLoadLibrary IS a member of the global namespace, and if you type ::, when VC++ generates that LONG list of functions in the global namespace, AfxLoadLibrary DOES show up on that list. What's the deal? How do I get it working? Thanks, augy
-
afxloadlibrary doesn't want to compile in my program. I'm writing and MFC app, and if I compile with the line: hLibrary = AfxLoadLibrary(pathtodll); I get a compiler error that AfxLoadLibrary is an undeclared identifier. If I use the global namespace, like so: hLibrary = ::AfxLoadLibrary(pathtodll); I get the error that AfxLoadLibrary isn't a member of the global namespace. The documentation says that AfxLoadLibrary IS a member of the global namespace, and if you type ::, when VC++ generates that LONG list of functions in the global namespace, AfxLoadLibrary DOES show up on that list. What's the deal? How do I get it working? Thanks, augy
Sounds weird. Did you try doing a "Rebuild All"? That usually fixes those kind of weird errors.
[
](http://www.canucks.com)"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
-
Sounds weird. Did you try doing a "Rebuild All"? That usually fixes those kind of weird errors.
[
](http://www.canucks.com)"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
-
Sounds weird. Did you try doing a "Rebuild All"? That usually fixes those kind of weird errors.
[
](http://www.canucks.com)"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
-
Hmmm, didn't fix it. The errors were the exact same. Does anybody know what header file afxloadlibrary is declared in? augy
afxdll_.h
[
](http://www.canucks.com)"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
-
afxdll_.h
[
](http://www.canucks.com)"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
-
Well, it compiles now, but the linker tells me that afxloadlibrary is an unresolved external. Is name mangling the problem? augy
You said your app was an MFC app, but it sounds to me like you have not included afx.h. Afx.h will automatically include afxdll_.h plus link your app to all the lib files needed.
[
](http://www.canucks.com)"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!