简体   繁体   English

XXX.exe中发生了未处理的“System.ExecutionEngineException”类型异常

[英]An unhandled exception of type 'System.ExecutionEngineException' occurred in XXX.exe

I have a DLL file that is written in C++. 我有一个用C ++编写的DLL文件。 I am try to use in C++ DLL in my c# code. 我尝试在我的c#代码中使用C ++ DLL。 C++ method is called correctly but it gives error after process completed. 正确调用C ++方法,但在完成进程后会出错。

Exception Details: 例外细节:

completed.System.ExecutionEngineException was unhandled Message=Exception of type 'System.ExecutionEngineException' was thrown. completed.System.ExecutionEngineException未处理Message =抛出类型'System.ExecutionEngineException'的异常。

I got the same problem with this code: 我在这段代码中遇到了同样的问题:

    [DllImport("camapi.dll", CharSet = CharSet.Unicode)]
private static extern CSTATUS_T CWRAPPER_GetFriendlyName(IntPtr pCameraBus, string sCamID, out StringBuilder sFriendlyName, 
                                                         uint uBufferSizeInWords);

public static string CWRAPPER_GetFriendlyName(IntPtr pCameraBus, string sCamID)
{
    var sFriendlyName = new StringBuilder(256);
    var status = CWRAPPER_GetFriendlyName(pCameraBus, sCamID, out sFriendlyName, (uint)s.Capacity + 1);
    return (status == CSTATUS_T.CSTATUS_SUCCESS) ? sFriendlyName.ToString() : "";
}

The problem was the "out" keyword. 问题是“out”关键字。 The example on MSDN doesn't have the 'out'. MSDN上的示例没有'out'。

Hope that helps someone... Simon 希望有人帮助......西蒙

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 沉默“未知模块中出现类型'System.ExecutionEngineException'的未处理异常”错误 - Silencing “An unhandled exception of type 'System.ExecutionEngineException' occurred in Unknown Module” error 读取 Azure 密钥保管库会引发异常:System.ExecutionEngineException:“引发了‘System.ExecutionEngineException’类型的异常。” - Reading Azure key vault throws exception: System.ExecutionEngineException: 'Exception of type 'System.ExecutionEngineException' was thrown.' DirectWriteForwarder.dll 中发生异常“System.ExecutionEngineException” - Exception 'System.ExecutionEngineException' occurred in DirectWriteForwarder.dll 尝试从user32.dll的GetWindowText()读取窗口时发生类型为'System.ExecutionEngineException'的未处理异常 - An unhandled exception of type 'System.ExecutionEngineException' occurring When trying to read window from GetWindowText() of user32.dll 为什么会收到“在系统数据dll中发生类型为system executeengineexception的未处理的异常”错误? - Why am I receiving a 'an unhandled exception of type system executionengineexception occurred in system data dll' error? 如何找到 System.ExecutionEngineException 异常的来源 - How to find source of System.ExecutionEngineException Exception RTEvents.exe中发生类型为'System.TypeInitializationException'的未处理异常 - An unhandled exception of type 'System.TypeInitializationException' occurred in RTEvents.exe exe中发生了类型为“System.IO.FileLoadException”的未处理异常 - An unhandled exception of type 'System.IO.FileLoadException' occurred in exe UretimPlan.exe 中出现“System.InvalidCastException”类型的未处理异常 - An unhandled exception of type 'System.InvalidCastException' occurred in UretimPlan.exe WindowsFormsApplication1.exe中发生了类型为'System.NullReferenceException'的未处理异常 - An unhandled exception of type 'System.NullReferenceException' occurred in WindowsFormsApplication1.exe
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM