有谁知道RGiesecke.DllExport到底是什么东西?
怎么用的,到底是什么原理啊?
不是说原生不支持导出的吗?
在加了一个第三方库之后
[DllExport()]到底干了什么?
[/code]using System;
using System.Collections.Generic;
using System.Linq;
using RGiesecke.DllExport;//关键是这个第三方库,到底怎么搞的?
using System.Runtime.InteropService
using System.Threading;namespace Demo
{
static class Program
{
static Int32 AuthCode; [return: MarshalAs(UnmanagedType.LPStr)]
[DllExport()]
public static String AppInfo() {
return "9,wtf.demo.echo";
} [DllExport()]
public static Int32 Initialize(Int32 authCode)
{
AuthCode = authCode;
return 0;
} [DllExport()]
public static Int32 eventStartup()
{
NativeMethods.CQ_addLog(AuthCode, 10, "什么鬼", "你好,这里是木馨!");
return 0;
} [DllExport()]
public unsafe static Int32 eventPrivateMsg(Int32 subType, Int32 sendTime, Int64 fromQQ, [MarshalAs(UnmanagedType.LPStr)] String message, Int32 font)
{
string x = message;
ThreadPool.QueueUserWorkItem(delegate(Object _)
{
NativeMethods.CQ_sendPrivateMsg(AuthCode, fromQQ, x);
});
return 0;
} }
}
怎么用的,到底是什么原理啊?
不是说原生不支持导出的吗?
在加了一个第三方库之后
[DllExport()]到底干了什么?
[/code]using System;
using System.Collections.Generic;
using System.Linq;
using RGiesecke.DllExport;//关键是这个第三方库,到底怎么搞的?
using System.Runtime.InteropService
using System.Threading;namespace Demo
{
static class Program
{
static Int32 AuthCode; [return: MarshalAs(UnmanagedType.LPStr)]
[DllExport()]
public static String AppInfo() {
return "9,wtf.demo.echo";
} [DllExport()]
public static Int32 Initialize(Int32 authCode)
{
AuthCode = authCode;
return 0;
} [DllExport()]
public static Int32 eventStartup()
{
NativeMethods.CQ_addLog(AuthCode, 10, "什么鬼", "你好,这里是木馨!");
return 0;
} [DllExport()]
public unsafe static Int32 eventPrivateMsg(Int32 subType, Int32 sendTime, Int64 fromQQ, [MarshalAs(UnmanagedType.LPStr)] String message, Int32 font)
{
string x = message;
ThreadPool.QueueUserWorkItem(delegate(Object _)
{
NativeMethods.CQ_sendPrivateMsg(AuthCode, fromQQ, x);
});
return 0;
} }
}
解决方案 »
- web服务错误:因 URL 意外地以“/SearchByKeyWord”结束,请求格式无法识别。。。郁闷啊
- 在word2003 或者word2007中如何漂亮的贴上c#的代码?
- vs2010 数据库编码不支持中文
- 向控件添加数据
- 在函数参数的地方需要一个硬盘上的bmp图像物理路径文件名字符串,我想在这个参数的位置上使用资源中的bmp图像,如何变通一下?
- C# 奇怪问题..请人帮解决~谢谢
- 将图片文件写入数据库时出错
- Rdlc报表打印问题
- C#中list型数据如何用groupby()和select()进行筛选
- asp.net中frames各部分的通讯问题
- redis 订阅发布相关
- 为什么modbus调试精灵显示写通讯超时
不过用C++/CLI就可以做的事情为啥要用没有经过广泛测试的第三方库?
这个麻烦的很,不建议用这个
楼主说的那个插件是可以导出标准的DLL,他相当于把C# 的DLL打包重新封装成C++的DLL了 然后暴露出C++的函数。在EasyHook上就有用到这个东西
各有优缺点吧.有空我抽时间整理资料发一篇教程吧.