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. Exporting Data

Exporting Data

Scheduled Pinned Locked Moved C / C++ / MFC
4 Posts 2 Posters 1 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.
  • P Offline
    P Offline
    Peter Liddle
    wrote on last edited by
    #1

    Hey guys I have been desperately trying to export data (just varibles) from an executable and load them into a DLL but i can't get it to work so far i have tried extern and __declspec(dllexport) and dllimport. But i have had no luck any ideas on how i do this. Peter

    A 1 Reply Last reply
    0
    • P Peter Liddle

      Hey guys I have been desperately trying to export data (just varibles) from an executable and load them into a DLL but i can't get it to work so far i have tried extern and __declspec(dllexport) and dllimport. But i have had no luck any ideas on how i do this. Peter

      A Offline
      A Offline
      Ancient Dragon
      wrote on last edited by
      #2

      You can't do that. You can only export objects from a DLL to an executable or another dll.

      P 1 Reply Last reply
      0
      • A Ancient Dragon

        You can't do that. You can only export objects from a DLL to an executable or another dll.

        P Offline
        P Offline
        Peter Liddle
        wrote on last edited by
        #3

        Yeah but i really really need to do it is there no way to work around it

        A 1 Reply Last reply
        0
        • P Peter Liddle

          Yeah but i really really need to do it is there no way to work around it

          A Offline
          A Offline
          Ancient Dragon
          wrote on last edited by
          #4

          Create the exported object in the dll, then in the application change its value. There is NO other way to do it. The reason should be obvious -- if the application were allowed to export and object, then the application would always have to be running whenever the dll is running. Lets say you have A.exe that export and object which X.dll uses. B.exe also uses X.dll but has no need for the object. When B.exe runs, X.dll is brought into memory, and because the dll references the object that was exported by A.exe, A.exe must also be executed. One of the purposes of a dll is to share its data and functions among many different applications. It would be terribly inefficnent to do it the other way around.

          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