请看。
C++:
编写C++库文件:
// testdll.cpp : 定义 DLL 应用程序的导出函数。
//
#include "stdafx.h"
#include "stdio.h"
extern "C" void test(char* p){
if(NULL != p){
OutputDebugString(p);
printf("%s\n",p);
}
else{
printf("empty p \n");
}
}
模块定义
LIBRARY
EXPORTS
test @1
C#
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
sta

本文介绍如何在C#中调用C++编写的动态链接库(DLL),并传递字符串参数。C++代码展示了DLL中接收字符串的函数,而在C#部分将展示如何进行调用。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



