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. Load DLL in program

Load DLL in program

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 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.
  • I Offline
    I Offline
    Irfan Ahmed
    wrote on last edited by
    #1

    Hi, I need help to load a third party DLL in my program. This DLL is not registring through regsvr32.

    M 1 Reply Last reply
    0
    • I Irfan Ahmed

      Hi, I need help to load a third party DLL in my program. This DLL is not registring through regsvr32.

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      For starters, look up LoadLibarary() and GetProcAddress(). If you're trying to use COM objects that are in the DLL, but aren't being registered properly, then you'll need to contact the author of the DLL. --Mike-- http://home.inreach.com/mdunn/ Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese? Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?

      I 1 Reply Last reply
      0
      • M Michael Dunn

        For starters, look up LoadLibarary() and GetProcAddress(). If you're trying to use COM objects that are in the DLL, but aren't being registered properly, then you'll need to contact the author of the DLL. --Mike-- http://home.inreach.com/mdunn/ Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese? Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?

        I Offline
        I Offline
        Irfan Ahmed
        wrote on last edited by
        #3

        Can you explain me a little about LoadLibrary. coz I don't know any functions in that DLL

        B 1 Reply Last reply
        0
        • I Irfan Ahmed

          Can you explain me a little about LoadLibrary. coz I don't know any functions in that DLL

          B Offline
          B Offline
          Ben M Stokland
          wrote on last edited by
          #4

          LoadLibrary, just load's the dll, so you can call functions in it. You need to have a function prototype to call a function in a dll. Lets make a function that will register a com-dll (just like regsvr32.exe does): typedef void (*f)(void); BOOL MyFuncCallsADLL(TCHAR* szDll) { f pf; // our function pointer HINSTANCE hDll = LoadLibrary(szDll); if(hDll == NULL) return FALSE; // we couldnt load library //get function address pf = (f)GetProcAddress(hDll, _T("DllRegisterServer")); if(pf == NULL) { FreeLibrary(hDll); return FALSE; //we couldn locate the function } //lets call that method pf(); FreeLibrary(hDll); return TRUE; } ;P

          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