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. How to combine a dll into exe-file ?

How to combine a dll into exe-file ?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
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.
  • S Offline
    S Offline
    suninwater
    wrote on last edited by
    #1

    Hi, guys: First time for me posting here, forgive my rudeness or other unwelcomed. I'm repairing a software with several dll's. My duty is to cut down any dll and import anything in them into main source code. Are there any articles on this topic or some advice ? TIA -gusd :confused:

    J 1 Reply Last reply
    0
    • S suninwater

      Hi, guys: First time for me posting here, forgive my rudeness or other unwelcomed. I'm repairing a software with several dll's. My duty is to cut down any dll and import anything in them into main source code. Are there any articles on this topic or some advice ? TIA -gusd :confused:

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      I've done this several times and the most effective way has been to convert the DLLs into libraries. First, get a list of all the files in the project (it's not unusual to have some files in the directory which aren't actually in the project.) Second, remove the DllInit function. Usually you don't need to replace it with anything since it doesn't do anything. If it does, you can often create a small private class and instantiate it globally. If that won't work, simply add Init() and DeInit() functions then call them from the main program in the proper manner and sequence. DO NOT get fancy at this point. It's a huge temptation, but one you must resist. Third, fix up the headers. You don't need the "dllimport"/"dllexport", etc stuff. (Nor do you need the .def file.) Add #pragma comment(lib, "put library name here.lib") to the header. Fourth. Ensure the libraries are subprojects of the master project. Add the subprojects to the master. Set the dependencies and paths and you're off! Fifth, oh, and go through the main project to ensure you aren't "manually" loading the DLLs or accessing them through a pointer or other such strangeness.

      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