C# 调用 VC++ 托管DLL,参数传结构体时
// DcmtkInvoker.h
#pragma once
using namespace System;
namespace DcmtkInvoker {
public ref struct PatientStruct
{
String^ patientID;
String^ patientName;
String^ code;
};
public ref class Invoker
{
public:
int GetPatientInfoByFileAddress(String^ fileAdress,PatientStruct^ patient);
};
}
C#调用
Invoker invo = new Invoker();
PatientStruct patient= new PatientStruct();
int result = invo.GetPatientInfoByFileAddress(e.FullPath,patient);
name = patient.patientID + patient.patientName;