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. event when loading a dll

event when loading a dll

Scheduled Pinned Locked Moved C / C++ / MFC
c++performancequestionlounge
2 Posts 2 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.
  • M Offline
    M Offline
    Mathefreak
    wrote on last edited by
    #1

    Hi, I've created a dll (C++) containing several functions, which are used inside an Excel-VBA-Project via dll-calls. What I want: when the dll is loaded into memory (i.e. when one of the functions is executed first time), a general function should be executed (purpose: check licence information etc.). Is there an event, which is triggered when the dll is loaded ? TIA M.

    B 1 Reply Last reply
    0
    • M Mathefreak

      Hi, I've created a dll (C++) containing several functions, which are used inside an Excel-VBA-Project via dll-calls. What I want: when the dll is loaded into memory (i.e. when one of the functions is executed first time), a general function should be executed (purpose: check licence information etc.). Is there an event, which is triggered when the dll is loaded ? TIA M.

      B Offline
      B Offline
      Blake Miller
      wrote on last edited by
      #2

      BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ); fdwReason -> DLL_PROCESS_ATTACH -> The DLL is being loaded into the virtual address space of the current process as a result of the process starting up or as a result of a call to LoadLibrary. DLLs can use this opportunity to initialize any instance data or to use the TlsAlloc function to allocate a thread local storage (TLS) index.

      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