Access Violation Exception/Crash from C++ callback to C# function

后端 未结 4 425
时光说笑
时光说笑 2021-01-12 21:22

So I have a native 3rd party C++ code base I am working with (.lib and .hpp files) that I used to build a wrapper in C++/CLI for eventual use in C#.

I\'ve run into

4条回答
  •  天涯浪人
    2021-01-12 22:11

    This doesn't directly answer your question, but it may lead you in the right direction as far as debug mode okay vs. release mode not okay:

    Since the debugger adds a lot of record-keeping information to the stack, generally padding out the size and layout of my program in memory, I was “getting lucky” in debug mode by scribbling over 912 bytes of memory that weren’t very important. Without the debugger, though, I was scribbling on top of rather important things, eventually walking outside of my own memory space, causing Interop to delete memory it didn’t own.

    What is the definition of DataLoggerWrap? A char field may be too small for the data you are receiving.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题