Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6955897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:47:50+00:00 2026-05-27T14:47:50+00:00

I am working with Visual C++. I have the source code of a library,

  • 0

I am working with Visual C++. I have the source code of a library, call it Lib. The library is made of a .lib and a .dll. I link the .lib in my main project statically and put the .dll in the directory where there is the executable. I allocate some memory in the main project (that is, load a file into memory), pass it to an object of the .dll to construct it and, when the program exits, the object call delete on that memory.

It seems to work, but i am not sure. What concerns me is that i allocate memory in my main project and de-allocate memory in a .dll. Are they on the same heap?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:47:51+00:00Added an answer on May 27, 2026 at 2:47 pm

    That works as long as you link to shared MSVC libraries with the memory allocation runtime. Then EXE and DLL share the same heap.

    If you break this dependency, the heap will no longer be shared and deleting the object in the different heap will ruin the app.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While working with ASP.NET using Visual Studio (2008) I have discomfort issue: source code
Around here we have been working with a bunch of Visual Source Safe repositories
I have a fully working Setup project within Visual Studio 2008 that takes inputs
I have written some code that makes use of an open source library to
I'm working on a C# project in Visual Studio 2010 where I have the
I am working on an open source C++ project, for code that compiles on
I'm working on a Visual C++ 8 project on WinXP but unfortunately I have
What would a developer used to working in Visual Studio have to give up
I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
I'm working in Visual Studio 2005 and have added a text file that needs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.