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. Problem calling a DLL from another DLL

Problem calling a DLL from another DLL

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++performancequestion
5 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.
  • M Offline
    M Offline
    Mohammad A Gdeisat
    wrote on last edited by
    #1

    Hi there, I have a DLL (DLL_1)for some measurement instrument that exports some functions, when I load DLL_1 from an MFC application and call Function_1 everything goes fine, but this not the way I want to use DLL_1. What I am trying to do is to create another DLL (DLL_2) to load the DLL_1 and call Function_1 but this always fails with a memory read error saying something like: "the memory at address 0x5435345 could not be read", this is wiered coz it is exactly the same code on the same machine. btw: Function_1 has one integer parameter so I don't think it has anything to do with passing parameters to the function! Could this have anything with the way DLLs manage memory? Any help? Any ideas? Thanks alot

    And ever has it been that love knows not its own depth until the hour of separation Mohammad Gdeisat

    C CPalliniC 2 Replies Last reply
    0
    • M Mohammad A Gdeisat

      Hi there, I have a DLL (DLL_1)for some measurement instrument that exports some functions, when I load DLL_1 from an MFC application and call Function_1 everything goes fine, but this not the way I want to use DLL_1. What I am trying to do is to create another DLL (DLL_2) to load the DLL_1 and call Function_1 but this always fails with a memory read error saying something like: "the memory at address 0x5435345 could not be read", this is wiered coz it is exactly the same code on the same machine. btw: Function_1 has one integer parameter so I don't think it has anything to do with passing parameters to the function! Could this have anything with the way DLLs manage memory? Any help? Any ideas? Thanks alot

      And ever has it been that love knows not its own depth until the hour of separation Mohammad Gdeisat

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      Did you try to use your debugger to retrieve more information about the problem ?

      Cédric Moonen Software developer
      Charting control [v2.0 - Updated] OpenGL game tutorial in C++

      M 1 Reply Last reply
      0
      • M Mohammad A Gdeisat

        Hi there, I have a DLL (DLL_1)for some measurement instrument that exports some functions, when I load DLL_1 from an MFC application and call Function_1 everything goes fine, but this not the way I want to use DLL_1. What I am trying to do is to create another DLL (DLL_2) to load the DLL_1 and call Function_1 but this always fails with a memory read error saying something like: "the memory at address 0x5435345 could not be read", this is wiered coz it is exactly the same code on the same machine. btw: Function_1 has one integer parameter so I don't think it has anything to do with passing parameters to the function! Could this have anything with the way DLLs manage memory? Any help? Any ideas? Thanks alot

        And ever has it been that love knows not its own depth until the hour of separation Mohammad Gdeisat

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        Are you allocating/unallocating memory? If the answer is yes, see, for instance [^], <[^]. :)

        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
        [My articles]

        In testa che avete, signor di Ceprano?

        M 1 Reply Last reply
        0
        • CPalliniC CPallini

          Are you allocating/unallocating memory? If the answer is yes, see, for instance [^], <[^]. :)

          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
          [My articles]

          M Offline
          M Offline
          Mohammad A Gdeisat
          wrote on last edited by
          #4

          No, I am not allocating any memory in my own code, I only call one function like this:

          int res = MyFunction(5);

          that's all I do. Thanks for the reply

          And ever has it been that love knows not its own depth until the hour of separation Mohammad Gdeisat

          1 Reply Last reply
          0
          • C Cedric Moonen

            Did you try to use your debugger to retrieve more information about the problem ?

            Cédric Moonen Software developer
            Charting control [v2.0 - Updated] OpenGL game tutorial in C++

            M Offline
            M Offline
            Mohammad A Gdeisat
            wrote on last edited by
            #5

            Hi, Unfortunately I have the DLL as release mode executable with no debugging information at all! the only thing the debugger will be able to display is some assembly code along with memory addresses which are not likely to be of much use, if you think that I can use them in someway plz let me know. btw: the function call (that craches when is made from a DLL) is so simple that it goes like this:

            int res = MyFunction(4);

            Cheers

            And ever has it been that love knows not its own depth until the hour of separation Mohammad Gdeisat

            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