Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

destructor delete problem with own dialog program with MFC (Unicode/Use MFC in a Shared DLL) VS2015 #1256

Open
dan2001o opened this issue Jan 2, 2024 · 0 comments

Comments

@dan2001o
Copy link

dan2001o commented Jan 2, 2024

Hi,

I really need help with this done: I have simple program, which is working fine except for deleting part

I use VS2015 and my Settings or my program are:

General: (Unicode + Use MFC in a Shared DLL)
Link: Multi-threaded DLL (/MD)
link with static lib "cryptlib.lib"

code

#define CRYPTOPP_DEFAULT_NO_DLL
#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1

#include <dll.h>
#include <cryptlib.h>
#include <sha.h>
#include <hex.h>
#include <filters.h>


void CMyDlg::TestCrypto()
{
  using namespace CryptoPP;

  SHA256 hash;
  std::string message = "abcdefghijklmnopqrstuvwxyz";
  std::string digest;
  {
    StringSink MySink(digest);
    HexEncoder MyHexEncoder(&MySink);
    HashFilter MyHash(hash, &MyHexEncoder);

    StringSource s(message, true, &MyHash);
    s.PumpAll();
  }
}

it building and linking fine, but after function is ran and deleting is being done this function it will crash

I have crypto 8.9 / I use WIN_32 Release with Static library (.lib) / Use MFC in a Shared DLL / Unicode / Multi-threaded DLL (/MD)

when I use another settings I get link errors etc. (the program must be same compiler options as the crypt.lib)

my problem looks a lot like this
https://stackoverflow.com/questions/59163281/runtime-library-heap-error-using-crypto-and-vs2019-with-mfc

but a solution of this was not found by me

Kind Regards
Dan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant