Solved

Freeing Allocated Memory

Posted on 2000-03-30
6
220 Views
Last Modified: 2013-11-20
Is there a known problem where memory is allocated (via malloc) in a C Based DLL, passing the allocated memory address back to an appication thru a callback function setting the address as an LParam? What seems to be happening (using NT) is that MFC application crashes whenever the application frees the memory (LParam Address) using free.
0
Comment
Question by:nweiher
6 Comments
 
LVL 4

Expert Comment

by:captainkirk
ID: 2670830
The memory allocated in the DLL is from its own memory pool unless it is an MFC Extension DLL. You may want to see if you can free the memory inside the DLL.
0
 
LVL 8

Expert Comment

by:gelbert
ID: 2670861
Possible problem could be that MFC app and your C dll were compiled with different versions of C runtime library
0
 
LVL 2

Accepted Solution

by:
DKostov earned 500 total points
ID: 2671069
Here the problem is basicly the same.
You can see some guidelines about the possible resolution.

http://www1.experts-exchange.com/bin/Q.10261061

captainkirk & gelbert are totally right.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 9

Expert Comment

by:ShaunWilde
ID: 2672396
Under debug - MFC uses a different malloc to that in release to enable it to do memory tracking. so mixing release and debug MFC builds can cause problems the same may also apply to 'vanilla' C dlls also.

0
 
LVL 3

Expert Comment

by:Try
ID: 2672562
"DKostov", since you were the one who answered the question at the address you've given, why not simply copy it over here!
0
 
LVL 2

Expert Comment

by:DKostov
ID: 2673864
"Try",
The discussion there is huge.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 117
sumDigits challenge 9 170
sameEnds challenge 3 179
building a service to accessed via telnet client, want colors ? 4 92
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question