C# 调用 VC++ 托管DLL,参数传结构体时

it2022-05-09  27

// 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;

转载于:https://www.cnblogs.com/nanshouyong326/archive/2009/05/22/1487110.html

相关资源:C#调用 C dll(包含传递自定义结构数组)

最新回复(0)