Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. afxloadlibrary

afxloadlibrary

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionhelp
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    the_augy
    wrote on last edited by
    #1

    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

    PJ ArendsP 1 Reply Last reply
    0
    • T the_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

      PJ ArendsP Offline
      PJ ArendsP Offline
      PJ Arends
      wrote on last edited by
      #2

      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!

      Within you lies the power for good; Use it!

      T 2 Replies Last reply
      0
      • PJ ArendsP PJ Arends

        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!

        T Offline
        T Offline
        the_augy
        wrote on last edited by
        #3

        I'll try it =] augy

        1 Reply Last reply
        0
        • PJ ArendsP PJ Arends

          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!

          T Offline
          T Offline
          the_augy
          wrote on last edited by
          #4

          Hmmm, didn't fix it. The errors were the exact same. Does anybody know what header file afxloadlibrary is declared in? augy

          PJ ArendsP 1 Reply Last reply
          0
          • T the_augy

            Hmmm, didn't fix it. The errors were the exact same. Does anybody know what header file afxloadlibrary is declared in? augy

            PJ ArendsP Offline
            PJ ArendsP Offline
            PJ Arends
            wrote on last edited by
            #5

            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!

            Within you lies the power for good; Use it!

            A 1 Reply Last reply
            0
            • PJ ArendsP PJ Arends

              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!

              A Offline
              A Offline
              Anonymous
              wrote on last edited by
              #6

              Well, it compiles now, but the linker tells me that afxloadlibrary is an unresolved external. Is name mangling the problem? augy

              PJ ArendsP 1 Reply Last reply
              0
              • A Anonymous

                Well, it compiles now, but the linker tells me that afxloadlibrary is an unresolved external. Is name mangling the problem? augy

                PJ ArendsP Offline
                PJ ArendsP Offline
                PJ Arends
                wrote on last edited by
                #7

                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!

                Within you lies the power for good; Use it!

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups