You didn't say whether your API project is a DLL or static library. Same for 
wxWidgets. But anyway you apparently have 4 projects, and you have to either 
somehow make sure they all use the same memory heap, or if there is more 
than one heap, you never allocate from one heap and free it to another. One 
thing you can try is to trace into the new/delete calls and see if they do 
end up calling the same memory allocation/deallocation routines (use 
disassembly to check the function addresses).

And here is sample code for GetNewAndDeleteForCryptoPP, if you want to try 
that.

extern "C" __declspec(dllexport) void __cdecl 
GetNewAndDeleteForCryptoPP(PNew &pNew, PDelete &pDelete)
{
        pNew = &operator new;
        pDelete = &operator delete;
}

--------------------------------------------------
From: "Paul" <[EMAIL PROTECTED]>
Sent: Wednesday, October 24, 2007 9:23 AM
To: "Crypto++ Users" <[EMAIL PROTECTED]>
Subject: heap corruption

>
>   I wrote a small set of methods (in a VS project) that calls the
> FIPS DLL methods, to give me the API needed for my application.  I
> wrote a small test program (in a separate VS project) that tests each
> method, and everything is working.
>
>   In my API project is the code for memory management, where Crypto++
> tells my app what heap to use (Wei's method 2).  By the way, I
> statically link with the Windows libraries.
>
>   I then added my API project to my main solution.  This solution
> uses, among other things, wxWidgets  During startup, I get a run time
> error that the heap is corrupted.
>
>   I see that several people have had this problem.  But I did not
> find a solution in any of the email threads.  Is there a solution?
>
>   I also tried running my test program with Purify.  This died before
> the first executable line of my test program could run.
>
>   While testing with my main solution, I noticed that wxWidgets had
> done a ton of allocating and freeing of memory (new/delete) prior to
> the corruption error.  It would seem that the FIPS DLL new/delete
> methods have some bugs.
>
>   Again, I ask, is there a solution?  I have read all of the related
> threads on the Google email list.
>
>   I would prefer not to dynamically link with the Windows libraries.
> However if I were to try that, I could not find any example code of
> using GetNewAndDeleteForCryptoPP (Wei's method 1).  I found one post
> where the person asked for such an example and was never given one.
>
>
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [EMAIL PROTECTED]
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---

Reply via email to