簡體   English   中英

Visual Studio 2017 上 c# 中的 C++.dll

[英]C++ .dll in c# on Visual Studio 2017

我是 csharp / c# 的新手。 我想構建一個使用已在 c++ 中創建的動態鏈接庫 (DLL) 的應用程序到我想使用 Visual Studio 2017 創建的 c# 應用程序中。我無法在任何資源中看到此類的適當示例。

Litterally, I want to convert the below shown c++ project (I have used #include "GDT.h" which is a DLL created using c++ in visual studio 2017) into c# project.

#include <iostream>
#include <Windows.h>
#include <string>
#include "GDT.h"

using namespace std;

int patientNumber = 007;
const wchar_t* patientName = L"Althaf Hussain";
const wchar_t* patientFirstName = L"Mustaq Ahmed";
int patientBirthDate = 24021998;
int insurenceNumber = 2189376;
const wchar_t* patientResidence = L"Magdeburg";
const wchar_t* patientStreet = L"Plauener Weg 8";
const wchar_t* insurenceStatus = L"Valid Till: 30.08.2022";
const wchar_t* patientSex = L"Male";
double patientHeight = 5.6;
double patientWeight = 65;
const wchar_t* patientFirstLanguage = L"German, English, Hindi, and Tamil";


void main()
{
    exportClientData_GdtClient(patientNumber, patientName, patientFirstName,
        patientBirthDate, insurenceNumber, patientResidence, patientStreet,
        insurenceStatus, patientSex, patientHeight, patientWeight,
        patientFirstLanguage);
}

任何回應都將是可觀的。

我是 csharp / c# 的新手。 我想構建一個使用已在 c++ 中創建的動態鏈接庫 (DLL) 的應用程序到我想使用 Visual Studio 2017 創建的 c# 應用程序中。我無法在任何資源中看到此類的適當示例。

Litterally, I want to convert the below shown c++ project (I have used #include "GDT.h" which is a DLL created using c++ in visual studio 2017) into c# project.

#include <iostream>
#include <Windows.h>
#include <string>
#include "GDT.h"

using namespace std;

int patientNumber = 007;
const wchar_t* patientName = L"Althaf Hussain";
const wchar_t* patientFirstName = L"Mustaq Ahmed";
int patientBirthDate = 24021998;
int insurenceNumber = 2189376;
const wchar_t* patientResidence = L"Magdeburg";
const wchar_t* patientStreet = L"Plauener Weg 8";
const wchar_t* insurenceStatus = L"Valid Till: 30.08.2022";
const wchar_t* patientSex = L"Male";
double patientHeight = 5.6;
double patientWeight = 65;
const wchar_t* patientFirstLanguage = L"German, English, Hindi, and Tamil";


void main()
{
    exportClientData_GdtClient(patientNumber, patientName, patientFirstName,
        patientBirthDate, insurenceNumber, patientResidence, patientStreet,
        insurenceStatus, patientSex, patientHeight, patientWeight,
        patientFirstLanguage);
}

任何回應都將是可觀的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM