从C#调用非托管C ++库(DLL)创建一个访问冲突错误(0000005) [英] Calling unmanaged C++ library (dll) from C# creates an access violation error (0xc0000005)

查看:1844
本文介绍了从C#调用非托管C ++库(DLL)创建一个访问冲突错误(0000005)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,我长的问题。我只是想包括我知道此刻的问题一切。

Sorry for the long question. I just wanted to include everything that I know about the problem at the moment.

我在使用Visual Studio 2008创建的C#Windows窗体程序调用用C ++编写的库。
C ++的DLL分析测量数据,其中包括几个样品。样品由一个函数传递给库( PDSetWaveSample ),这需要一个结构类型作为参数。<​​BR> 之后所有样品都设置,测量数据处理与另一个功能( PD preProcess ),这也需要一个结构类型作为参数。<​​BR> C ++的DLL持有在其内部数据结构中的所有测量数据并没有全部处理获得的结果。

I'm using Visual Studio 2008 to create a Windows Form program in C# that calls a library written in C++.
The C++ DLL analyzes measurement data, which consists of several samples. The samples are passed to the library by a function (PDSetWaveSample) which takes a struct as a parameter.
After all samples are set, the measurement data is processed with another function (PDPreProcess) which also takes a struct as a parameter.
The C++ DLL is holding all the measurement data in its internal data structures and does all the processing to obtain results.

一切似乎直到节目开始处理测量数据正常。在这一点上的程序崩溃并退出与此错误:

Everything seems to function correctly until the program starts processing the measurement data. At that point the program crashes and exits with this error:

该方案的XXX.vshost.exe:托管已退出与code -1073741819(0000005)。

The program 'XXX.vshost.exe: Managed' has exited with code -1073741819 (0xc0000005).

我会添加一些更多的调试信息,并在这个问题的C#源$ C ​​$ C后。

I’ll add some more debugging information and the C# source code later in this question.

你有什么提示了前进或者是可能会导致此?

我运行Windows XP专业版,2002版SP 3。

I am running Windows XP Professional, Version 2002 SP 3.

在程序崩溃时,它首先给这个错误信息

When the program crashes, it first gives this error message

型System.ExecutionEngineException的未处理的异常未知模块发生了。

An unhandled exception of type 'System.ExecutionEngineException' occurred in Unknown Module.

和中断或继续的可能性。我选择分手。

and the possibility to Break or Continue. I choose to Break.

在我看装配:

没有符号被加载的任何调用堆栈帧。该人士$ ​​C $ C无法显示。

No symbols are loaded for any call stack frame. The source code cannot be displayed.

据调试器,在那里的错误发生点的组装是这样的:

According to the debugger, the assembly at the point where the error happens looks like this:

7C90E4FA  call        7C90E528 
7C90E4FF  mov         eax,dword ptr [esp] 
7C90E502  mov         esp,ebp 
7C90E504  pop         ebp  
7C90E505  ret              
7C90E506  lea         esp,[esp] 
7C90E50D  lea         ecx,[ecx] 
7C90E510  mov         edx,esp 
7C90E512  sysenter         
==>7C90E514  ret              
7C90E515  lea         esp,[esp] 
7C90E51C  lea         esp,[esp] 
7C90E520  lea         edx,[esp+8] 
7C90E524  int         2Eh  
7C90E526  ret              
7C90E527  nop              
7C90E528  push        ebp  
7C90E529  mov         ebp,esp 
7C90E52B  pushfd           

本处停止执行<$​​ C $ C> 7C90E514 RET (我打上==>)

输出窗口显示以下信息:

The output window shows the following messages:

'CalculationForm.exe': Loaded 'C:\CalculationForm\CalculationForm\bin\Debug\CalculationForm.exe', No native symbols in symbol file.  
'CalculationForm.exe': Loaded 'C:\WINNT\system32\ntdll.dll'  
'CalculationForm.exe': Loaded 'C:\WINNT\system32\kernel32.dll'  
'CalculationForm.exe': Loaded 'C:\WINNT\system32\sysfer.dll'  
'CalculationForm.exe': Loaded 'C:\WINNT\system32\mscoree.dll'  
'CalculationForm.exe': Loaded 'C:\WINNT\system32\advapi32.dll'  
'CalculationForm.exe': Loaded 'C:\WINNT\system32\rpcrt4.dll'  
'CalculationForm.exe': Loaded 'C:\WINNT\system32\secur32.dll'  
'CalculationForm.exe': Loaded 'C:\WINNT\system32\shlwapi.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\gdi32.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\user32.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\msvcrt.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\imm32.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989\msvcr80.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\shell32.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\comctl32.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\comctl32.dll'
'CalculationForm.exe': Loaded 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Culture.dll' 
'CalculationForm.exe': Unloaded 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Culture.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\mscorlib\17179b71d7680399c00ce88ddc310209\mscorlib.ni.dll' 
'CalculationForm.exe' (Managed): Loaded 'C:\WINNT\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\ole32.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\MSCTF.dll' 
'CalculationForm.exe' (Managed): Loaded 'C:\Tyohakemisto\WaveRoller\CalculationForm\CalculationForm\bin\Debug\CalculationForm.exe', Symbols loaded. 
'CalculationForm.exe': Loaded 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\System\2f867d97fb1a34e4d6985780631574bb\System.ni.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\System.Drawing\f78f03ba3b1b21e3b26369402c117d33\System.Drawing.ni.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\System.Windows.Forms\06b728c1e4ea291d4febee5ca33db4b4\System.Windows.Forms.ni.dll' 
'CalculationForm.exe' (Managed): Loaded 'C:\WINNT\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 
'CalculationForm.exe' (Managed): Loaded 'C:\WINNT\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 
'CalculationForm.exe' (Managed): Loaded 'C:\WINNT\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 
'CalculationForm.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\System.Configuration\b2f3e4c45a980474c2dd08166038d645\System.Configuration.ni.dll' 
'CalculationForm.exe' (Managed): Loaded 'C:\WINNT\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 
'CalculationForm.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\System.Xml\8ee82dfeff03ca87492149cdcbfc3f21\System.Xml.ni.dll' 
'CalculationForm.exe' (Managed): Loaded 'C:\WINNT\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 
'CalculationForm.exe': Loaded 'ImageAtBase0x10000000'
'CalculationForm.exe': Unloaded 'ImageAtBase0x10000000' 
'CalculationForm.exe': Loaded 'C:\WINNT\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll' 
'CalculationForm.exe' (Managed): Loaded 'C:\WINNT\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll' 
'CalculationForm.exe': Loaded 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\Packages\Debugger\x86\Microsoft.VisualStudio.Debugger.Runtime.Impl.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.4148_x-ww_d495ac4e\msvcr90.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\uxtheme.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\xpsp2res.dll', Binary was not built with debug information. 
'CalculationForm.exe' (Managed): Loaded 'C:\CalculationForm\CalculationForm\bin\Debug\AxInterop.PDCOMMXLib.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.6002.22509_x-ww_c7dad023\GdiPlus.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\version.dll' 
'CalculationForm.exe': Unloaded 'C:\WINNT\system32\version.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\MSCTFIME.IME' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\oleaut32.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\Microsoft.NET\Framework\v2.0.50727\diasymreader.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\clbcatq.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\comres.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\version.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\msi.dll' 
'CalculationForm.exe': Loaded 'C:\Nortek\PdCommX\PdCommX.dll', Binary was not built with debug information. 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\mfc100.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\msvcr100.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\msimg32.dll'
'CalculationForm.exe': Loaded 'C:\WINNT\system32\msvcp100.dll' 
'CalculationForm.exe': Loaded 'C:\WINNT\system32\sxs.dll' 
'CalculationForm.exe' (Managed): Loaded 'C:\ CalculationForm\CalculationForm\bin\Debug\Interop.PDCOMMXLib.dll'
'CalculationForm.exe': Loaded 'C:\WINNT\assembly\NativeImages_v2.0.50727_32\Accessibility\775f9f0da40c277eb7d460084858a2ac\Accessibility.ni.dll'
'CalculationForm.exe' (Managed): Loaded 'C:\WINNT\assembly\GAC_MSIL\Accessibility\2.0.0.0__b03f5f7f11d50a3a\Accessibility.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 'Win32 Thread' (0x1f08) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1cc4) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1598) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xaa8) has exited with code 0 (0x0). 
The thread 'Win32 Thread' (0x1db8) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1e74) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x1958) has exited with code 0 (0x0).
The program '[4656] CalculationForm.exe: Managed' has exited with code 0 (0x0).
The program '[4656] CalculationForm.exe: Native' has exited with code 0 (0x0).

在程序结束时,调用堆栈是:

When program ends, the call stack is:

ntdll.dll!7c90e514()    
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] 
ntdll.dll!7c90df5a()    
kernel32.dll!7c8025db()     
mscorwks.dll!79e8c639()     
mscorwks.dll!79e8c56f()     
mscorwks.dll!79f7466d()     
mscorwks.dll!7a105cf1()     
mscorwks.dll!7a105e37()     
mscorwks.dll!7a1061db()     
mscorwks.dll!7a09c314()     
mscorwks.dll!79f504da()     
mscorwks.dll!79ef4755()     
ntdll.dll!7c9032a8()    
ntdll.dll!7c90327a()    
ntdll.dll!7c92a8c3()    
ntdll.dll!7c90e48a()    
ntdll.dll!7c94b721()    
ntdll.dll!7c919f68()    
ntdll.dll!7c919f68()    
ntdll.dll!7c919f68()    
ntdll.dll!7c919f68()    
ntdll.dll!7c910385()    
ntdll.dll!7c917c51()    
ntdll.dll!7c917e8f()    
mscorwks.dll!79e71b4c()     
mscorwks.dll!79e821f9()     
mscorwks.dll!79e96571()     
mscorwks.dll!79e965a4()     
mscorwks.dll!79e965c2()     
mscorwks.dll!79ecca87()     
mscorwks.dll!79ef531b()     
mscorwks.dll!79ef6dd8()     
mscorwks.dll!79ef6e76()     
mscorwks.dll!79ef4755()     
ntdll.dll!7c9032a8()    
ntdll.dll!7c90327a()    
ntdll.dll!7c92a8c3()    
ntdll.dll!7c90e48a()    
ntdll.dll!7c917ca7()    
ntdll.dll!7c917e8f()    
mscorwks.dll!7a0ecb29()     
mscorwks.dll!79f6879a()     
mscorwks.dll!79f68780()     
mscorwks.dll!79f73f3d()     
mscorwks.dll!79ecd659()     
mscorwks.dll!79e71b4c()     
mscorwks.dll!79e821f9()     
mscorwks.dll!79e96571()     
mscorwks.dll!79e965a4()     
mscorwks.dll!79e965c2()     
mscorwks.dll!79f87ad3()     
mscorwks.dll!79f87c32()     
mscorlib.ni.dll!792d5428()  
mscorlib.ni.dll!792d51d6()  
mscorlib.ni.dll!792d50be()  
mscorwks.dll!79e71b4c()     
mscorwks.dll!79e821f9()     
mscorwks.dll!79e96571()     
mscorwks.dll!79e965a4()     
mscorwks.dll!79f29e09()     
mscorwks.dll!79f2a1e0()     
mscorwks.dll!79f2a130()     
mscorwks.dll!79f29837()     
mscorwks.dll!79f298bc()     
mscorwks.dll!79f29967()     
System.ni.dll!7a574b73()    
System.Windows.Forms.ni.dll!7b1c87be()  
mscorwks.dll!79e71b4c()     
mscorwks.dll!79e821f9()     
System.Windows.Forms.ni.dll!7b1c86a0()  
System.Windows.Forms.ni.dll!7b1c8621()  
System.Windows.Forms.ni.dll!7b6fa167()  
mscorwks.dll!79e71b4c()     
mscorwks.dll!79e821f9()     
mscorwks.dll!79fc1fe2()     
mscorwks.dll!79fc219a()     
mscorwks.dll!79fc22be()     
mscorwks.dll!79f077ad()     
mscorwks.dll!79e8c4ec()     
mscorwks.dll!79e8840b()     
mscorwks.dll!79f13cb5()     
mscorwks.dll!79f1129c()     
mscorwks.dll!79f07e17()     
mscoree.dll!7900b77b()  
mscoree.dll!7900b73d()  
mscoree.dll!79004de3()  
kernel32.dll!7c817077()     

我创建了一个包装类C ++ DLL。包装类是基于该库的头文件:

I have created a wrapper class for the C++ DLL. The wrapper class is based on the header file for the library:

#ifndef _PDWAVEAPI_H__  
#define _PDWAVEAPI_H__

#ifdef PDWAVE_EXPORTS
#define PDWAVE_API __declspec(dllexport)
#else
#define PDWAVE_API __declspec(dllimport)
#endif

typedef struct {
   bool  bValid;
   float fPressure;
   float fDistance;
   float fVel[4];
   unsigned short nAmp[4];
 } PDWaveSample;

typedef struct {
    float fST[4096];
    float fWinFloor;
    float fWinCeil;
    bool bUseWindow;
    bool bSTOk;
    bool bGetRawAST;
    bool bValidBurst;
 } PDWaveBurst;


PDWAVE_API int __stdcall PDSetWaveSample(PDWaveSample *pWaveSample);
PDWAVE_API int __stdcall PDPreProcess(int nSample, PDWaveBurst *pWaveBurst);

和C#的包装类是:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices; // DllImport

namespace Cpp_LibraryApi
{
    [StructLayout(LayoutKind.Sequential)]
    public struct PDWaveSample
    {
        public bool bValid;                             
        public float fPressure;                         
        public float fDistance;                         
        public float[] fVel;
        public ushort[] nAmp

        // Constructor to initialize tables

        public static PDWaveSample Create()
        {
            PDWaveSample DataStruct = new PDWaveSample();
            DataStruct.fVel = new float[4];
            DataStruct.nAmp = new ushort[4];
            return DataStruct;
        }
    }
    [StructLayout(LayoutKind.Sequential)]
    public  struct PDWaveBurst {
        public float[] fST;
        public float fWinFloor;
        public float fWinCeil;
        public bool bUseWindow;
        public bool bSTOk;
        public bool bGetRawAST;
        public bool bValidBurst;

        public static PDWaveBurst Create()
        {
            PDWaveBurst DataStruct = new PDWaveBurst();
            DataStruct.fST = new float[Constants.PD_MAX_WAVEMEAS_AST];
            return DataStruct;
        }
    }

    public class Cpp_LibraryWrapper
    {
        [DllImport("cpp_library.dll")]
        public static extern int PDSetWaveSample(ref PDWaveSample pWaveSample);

        [DllImport("cpp_library.dll")]
        public static extern int PDPreProcess(int nSample, ref PDWaveBurst pWaveBurst);

    }
}

Windows窗体应用程序使用这些函数以下列方式:

The Windows Forms application is using these functions in the following way:

我已经简化了功能一点点。实际上,测量使用第三方ActiveX组件串行线读取。

I have simplified the function a little bit. Actually the measurements are read from a serial line using a third party ActiveX component.

using System;
using System.Configuration;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;
using System.Timers;
using System.Diagnostics;

namespace CalculationForm
{
    public partial class frmCalculationForm : Form
    {
        int nBurstSamples = 0;

        public frmCalculationForm()
        {
            InitializeComponent();
        }

        private void OnNewData_Event(object sender, Events_OnNewDataEvent e)
        {
            try
            {
                Cpp_LibraryApi.PDWaveSample WaveSampleData = Cpp_LibraryApi.PDWaveSample.Create();

                ReadWaveSample(ref WaveSampleData);
                SetWaveSample(WaveSampleData);

                if (++nBurstSamples > 512)
                {
                    // Process
                    ProcessBurstData(nBurstSamples);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message.ToString());
            }
        }

        public void ReadWaveSample(ref Cpp_LibraryApi.PDWaveSample WaveSampleData)
        {
            float[] dVel = new float[4] { (float)-3.26, (float)-2.808, (float)-3.651, (float)-3.43 };
            ushort[] usAmp = new ushort[4] { 41, 40, 0, 0 };
            WaveSampleData.bValid = true;
            WaveSampleData.fPressure = 12.432;
            WaveSampleData.fDistance = 2.64;
            WaveSampleData.fVel = dVel;
            WaveSampleData.nAmp = usAmp;
        }

        public void SetWaveSample(Cpp_LibraryApi.PDWaveSample WaveSampleData)
        {
            Cpp_LibraryWrapper.PDSetWaveSample(ref WaveSampleData);
        }

        public void ProcessBurstData(int nSamples)
        {
            try
            {
                Cpp_LibraryApi.PDWaveBurst WaveBurstData = Cpp_LibraryApi.PDWaveBurst.Create();

                WaveBurstData.fST = new float[4096];
                WaveBurstData.fWinFloor = (float)1.25;
                WaveBurstData.fWinCeil = 2;
                WaveBurstData.bUseWindow = false;
                WaveBurstData.bSTOk = false;
                WaveBurstData.bGetRawAST = false;
                WaveBurstData.bValidBurst = false;

                Cpp_LibraryWrapper.PDPreProcess(nSamples, ref WaveBurstData);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message.ToString());
            }
        }
    }
}

一切似乎顺利,直到程序到达测量处理阶段。当

Everything seems to go well until the program reaches the measurement processing phase. When

Cpp_LibraryWrapper.PDPreProcess(nSamples, ref WaveBurstData);

被调用,执行与此错误停止:

is called, the execution stops with this error:

该方案的XXX.vshost.exe:管理。已退出与code -1073741819(0000005)

The program 'XXX.vshost.exe: Managed' has exited with code -1073741819 (0xc0000005).

我已经设置这些调试选项:

I have set these debugging options:

  • 启用非托管code调试
  • 启用在Visual Studio宿主进程
  • 在公共语言运行库异常抛出
  • 在Win32异常 - >访问冲突抛出

推荐答案

您的结构是正确整理,因为你没有申报阵列完全正确。你需要告诉他们是固定长度数组编组。

Your structs are marshalled incorrectly because you didn't declare the arrays quite right. You need to tell the marshaller that they are fixed length arrays.

修改

在我原来的答案,我错过了另外的错误是,布尔成员没有正确整理。默认编组为4个字节的Windows BOOL ,但你需要1个字节的C ++ 布尔。低于现在的code正确处理。很抱歉的混乱。

In my original answer I missed the addition error that the bool members were not marshalled correctly. The default marshalling is for the 4 byte Windows BOOL but you need 1 byte C++ bool. The code below now handles that correctly. Sorry for the confusion.

public struct PDWaveSample
{
    [MarshalAs(UnmanagedType.I1)]
    public bool bValid;                             
    public float fPressure;                         
    public float fDistance;                         
    [MarshalAs(UnmanagedType.LPArray, SizeConst=4)]
    public float[] fVel;
    [MarshalAs(UnmanagedType.LPArray, SizeConst=4)]
    public ushort[] nAmp
}

public struct PDWaveBurst {
    [MarshalAs(UnmanagedType.LPArray, SizeConst=4096)]
    public float[] fST;
    public float fWinFloor;
    public float fWinCeil;
    [MarshalAs(UnmanagedType.I1)]
    public bool bUseWindow;
    [MarshalAs(UnmanagedType.I1)]
    public bool bSTOk;
    [MarshalAs(UnmanagedType.I1)]
    public bool bGetRawAST;
    [MarshalAs(UnmanagedType.I1)]
    public bool bValidBurst;
}

这篇关于从C#调用非托管C ++库(DLL)创建一个访问冲突错误(0000005)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆