• Advertisement
Sign in to follow this  

C++/CLI.NET and Crypto++ problem

This topic is 3794 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone used Crypto++ (C++ crypthology library ) with C++/CLI.net.I couldn't use it with C++/CLI.net (with C++ everything is ok ).I dynamically build a Crypto++ dll and linked it to the Visual Studio project.I successfully compiled and run the project.But program outputs a messagebox saying "The applicaiton failed to initialize properly(0xc00000005).Click on OK to terminate the application" and fails to start... Do anyone knows why?why can not i use my so-called native dll with C++/CLI.net.

Share this post


Link to post
Share on other sites
Advertisement
Have you correctly imported the non-managed DLL exports into the managed environment?

Skizz

Share this post


Link to post
Share on other sites
No, I mean something like this:

[StructLayout (LayoutKind::Sequential, CharSet = CharSet::Auto)]
public value class LOGFONT
{
public:
int lfHeight;
int lfWidth;
int lfEscapement;
int lfOrientation;
int lfWeight;
[MarshalAs(UnmanagedType::U1)]
bool lfItalic;
[MarshalAs(UnmanagedType::U1)]
bool lfUnderline;
[MarshalAs(UnmanagedType::U1)]
bool lfStrikeOut;
unsigned char lfCharSet;
unsigned char lfOutPrecision;
unsigned char lfClipPrecision;
unsigned char lfQuality;
unsigned char lfPitchAndFamily;
[MarshalAs(UnmanagedType::ByValTStr, SizeConst = 32)]
String ^lfFaceName;
};

which describes the structure layout for data passed between managed and unmanaged code. If there's a difference in the memory layout, odd things can happen.

Skizz

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement