delphi编写的dll函数如下:
function SendDatafun(comport:integer;bps:longint;address:integer;sendData:pchar;color:integer;showMode,showSpeed,showTime:integer):integer;
StdCall external '../dlltpzp.DLL';
在C#中如何调用,我是用下边的方法,总是提示“尝试读取或写入受保护的内存。这通常指示其他内存已损坏。”
[DllImport("dlltpzp.dll", CharSet = CharSet.Ansi)]
private static extern int SendDatafun(int comport, long bps, int address, StringBuilder sendData, int color, int showMode, int showspeed, int showtime);
在线等,各位大神帮帮忙啊
function SendDatafun(comport:integer;bps:longint;address:integer;sendData:pchar;color:integer;showMode,showSpeed,showTime:integer):integer;
StdCall external '../dlltpzp.DLL';
在C#中如何调用,我是用下边的方法,总是提示“尝试读取或写入受保护的内存。这通常指示其他内存已损坏。”
[DllImport("dlltpzp.dll", CharSet = CharSet.Ansi)]
private static extern int SendDatafun(int comport, long bps, int address, StringBuilder sendData, int color, int showMode, int showspeed, int showtime);
在线等,各位大神帮帮忙啊
解决方案 »
- 严重问题:后台程序第三方dll的消息提示框
- C#怎么实现C语言memmove的功能
- 如何实现限制一个函数的执行时间?也就是设定一个强制停止函数运行的时间。
- 请教一个在对象里进行搜索的算法!
- 下载了Developer Express .NET 的工具,都是英文的,不知要怎么才能调用呢??
- 菜鸟入门:关于接口的这个用法是什么意思啊
- 请问我用c#的webClient.DownloadFile下载http文件,怎么样才能知道http文件的下载次数呢?
- 如何执行好asp:button的事件后打开模态框,当关闭模态框再刷页面
- 请问大家有用.NET或VB语言写的ERP系统的源代码吗?
- 论为什么不用Jtoken 去解析对象
- .net制作安装包,如何让指定文件安装到固定目录
- mciSendString播放音效问题
[DllImport("",CallingConvention=CallingConvention.StdCall)]
如果还不行,把StringBuilder sendData改为IntPtr sendData,然后自己分配非托管内存,调用.