是否可以在VS C ++输出从C#DLL函数样的? [英] Is is possible to export functions from a C# DLL like in VS C++?

查看:94
本文介绍了是否可以在VS C ++输出从C#DLL函数样的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VS C / C ++,你可以使用的externC__declspec(DLLEXPORT)函数的声明 -

In VS C/C++ you could use extern "C" __declspec(dllexport) -function declaration-.

我如何做到这一点在C#的dll?有没有等价的C以上code#code?

How do I accomplish this in a C# dll? Is there C# code equivalent to the above code?

编辑:更多信息

我想创建一个记事本++加入,我想用C#,但迄今为止我见过的常用方法是使用传统的C ++ code与上面调用的出口数的功能该记事本+ +预计将导入和调用。有使用C#示例应用程序,但是这仍然需要一个装载机DLL,这是我从评论/回答假设下面是C#的唯一途径。

I am trying to create an add in for Notepad++ and I want to use C#, but the common way I've seen so far is to use legacy C++ code with the above call to export a few of the functions that Notepad++ expects to import and call. There is an example app using C#, but this still requires a loader DLL, which I assume from the comments/answers below is the only way for C#.

推荐答案

托管输出
<一href=\"https://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports\">https://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports

这篇关于是否可以在VS C ++输出从C#DLL函数样的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆