동안 AccessViolation :나는이 DLL 호출이 PInvoke를
[DllImport("FreqCntPcIntf.dll", CallingConvention = CallingConvention.StdCall)]
public static extern Intf_ErrorType FreqCntIntf_Init(
ref byte InstNo,
string InstName,
string PortServerName,
ulong UartComPort,
ulong MaxBlockTime);
enum Intf_ErrorType
{
...
}
그리고 C++ 선언은 이것이다 :
typedef enum
{
....
} RSENUM8(Intf_ErrorType);
#define FREQCNTINTF_API __declspec(dllexport)
typedef rsuint8 InstanceNoType;
typedef unsigned char rsuint8;
#define RSENUM32(EnumName) Enum_##EnumName; typedef rsuint32 EnumName
내가 통화 중 AccessViolation가 나타납니다
FREQCNTINTF_API Intf_ErrorType STDCALL FreqCntIntf_Init(InstanceNoType* InstNo, const char* InstName, const char* PortServerName, rsuint32 UartComPort, rsuint32 MaxBlockTime);
. 버그를 찾으려면 어디를 봐야합니까?
C#에서 ULONG이없는 4 바이트 –