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;

posted @ 2009-05-22 14:51  南守拥  阅读(387)  评论(0编辑  收藏  举报