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. export

export

Scheduled Pinned Locked Moved C / C++ / MFC
toolsquestion
6 Posts 4 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.
  • V Offline
    V Offline
    viliam
    wrote on last edited by
    #1

    I tryied to export function from the executable module. In the same way as a dll export. It "works" - I can see it as an export in Dependency walker utility But: Whan I use LoadLibrary from different executable to load it it also work but when i call it, it always crashes inside. (when i rewrite first exe into dll it works fain) Is there any special steps which must be done to export function from EXE module?

    viliam

    W M 2 Replies Last reply
    0
    • V viliam

      I tryied to export function from the executable module. In the same way as a dll export. It "works" - I can see it as an export in Dependency walker utility But: Whan I use LoadLibrary from different executable to load it it also work but when i call it, it always crashes inside. (when i rewrite first exe into dll it works fain) Is there any special steps which must be done to export function from EXE module?

      viliam

      W Offline
      W Offline
      WindowsPistha
      wrote on last edited by
      #2

      Hi , Just try to debug the Exported function through the Exe where your invoking the exported function. I hope there must be a problem with App ptr.

      1 Reply Last reply
      0
      • V viliam

        I tryied to export function from the executable module. In the same way as a dll export. It "works" - I can see it as an export in Dependency walker utility But: Whan I use LoadLibrary from different executable to load it it also work but when i call it, it always crashes inside. (when i rewrite first exe into dll it works fain) Is there any special steps which must be done to export function from EXE module?

        viliam

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        I don't know if that's going to work since the exe loaded with LoadLibrary hasn't run so no initialization is done. Can you even step into the loaded exe file's code with the debugger? Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        C V 2 Replies Last reply
        0
        • M Mark Salsbery

          I don't know if that's going to work since the exe loaded with LoadLibrary hasn't run so no initialization is done. Can you even step into the loaded exe file's code with the debugger? Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          C Offline
          C Offline
          CPallini
          wrote on last edited by
          #4

          Mark Salsbery wrote:

          I don't know if that's going to work since the exe loaded with LoadLibrary hasn't run so no initialization is done.

          I agree. Probably he can only extract resources. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

          M 1 Reply Last reply
          0
          • C CPallini

            Mark Salsbery wrote:

            I don't know if that's going to work since the exe loaded with LoadLibrary hasn't run so no initialization is done.

            I agree. Probably he can only extract resources. :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            CPallini wrote:

            Probably he can only extract resources.

            That was my understanding :)

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            1 Reply Last reply
            0
            • M Mark Salsbery

              I don't know if that's going to work since the exe loaded with LoadLibrary hasn't run so no initialization is done. Can you even step into the loaded exe file's code with the debugger? Mark

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              V Offline
              V Offline
              viliam
              wrote on last edited by
              #6

              thankx, I can step into the function and if function is empty or just sets variables - it works The problem begun whan i called some API function GetModuleFileName(NULL, szPath, _MAX_PATH); does not work and some others thow exception. You probably right, there is some initialization missing ..for resource it definetelly works.

              viliam

              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