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. Invalid Address specified to RtlFreeHeap

Invalid Address specified to RtlFreeHeap

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++debuggingannouncement
3 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.
  • R Offline
    R Offline
    Rainer Mangold
    wrote on last edited by
    #1

    I get this error message when I call a function in a MFC-Extension Dll (in Release-Mode) while debugging my MFC-Application. If both (App and Dll) are in the same state (debug or release) everything is fine. I was able to reduce the problem to only a few lines of code. However I can not see what should be wrong in my program. To reproduce this problem create an extension Dll and add the two files foo.h and foo.cpp ----- foo.h IMP_EXP void Foo(CString& sVal); ----- foo.cpp #include "stdafx.h" #define IMP_EXP __declspec(dllexport) #include "foo.h" void Foo(CString& sVal) { sVal = "12345"; } ----- end of foo.cpp Then create a MFC-App and include the following lines ----- any cpp-file of your app #define IMP_EXP __declspec(dllimport) #include "[Your Path]\Foo.h" #pragma comment(lib, "[Your Dll-Name]") void MyFunc() { CString str; str.Empty(); Foo(str); } Thanks for your help :confused: Rainer

    M 1 Reply Last reply
    0
    • R Rainer Mangold

      I get this error message when I call a function in a MFC-Extension Dll (in Release-Mode) while debugging my MFC-Application. If both (App and Dll) are in the same state (debug or release) everything is fine. I was able to reduce the problem to only a few lines of code. However I can not see what should be wrong in my program. To reproduce this problem create an extension Dll and add the two files foo.h and foo.cpp ----- foo.h IMP_EXP void Foo(CString& sVal); ----- foo.cpp #include "stdafx.h" #define IMP_EXP __declspec(dllexport) #include "foo.h" void Foo(CString& sVal) { sVal = "12345"; } ----- end of foo.cpp Then create a MFC-App and include the following lines ----- any cpp-file of your app #define IMP_EXP __declspec(dllimport) #include "[Your Path]\Foo.h" #pragma comment(lib, "[Your Dll-Name]") void MyFunc() { CString str; str.Empty(); Foo(str); } Thanks for your help :confused: Rainer

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Release and debug MFC use different and incompatible memory allocators. What you're seeing is a just result of that. You need to have all your modules built for the same mode (debug/release). --Mike-- http://home.inreach.com/mdunn/ The Signature, back by popular demand: Buffy. Pajamas.

      R 1 Reply Last reply
      0
      • M Michael Dunn

        Release and debug MFC use different and incompatible memory allocators. What you're seeing is a just result of that. You need to have all your modules built for the same mode (debug/release). --Mike-- http://home.inreach.com/mdunn/ The Signature, back by popular demand: Buffy. Pajamas.

        R Offline
        R Offline
        Rainer Mangold
        wrote on last edited by
        #3

        Hello Mike, thanks a lot for your answer. :) So it looks like this is "by design" but not "by desire":(( . Because if you have several projects using some well tested "common dlls", you usually otherwise don't need these in debug and release mode, while debugging one of your apps. Rainer By the way: Thank you very much for your wonderfull tutorials ! ! ! !

        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