unsigned char*  等价 BYTE*

例1:

C++:

int __stdcall LIVESCAN_GetFPRawData(int nChannel, unsigned char *pRawData);

C#

[DllImport("GALS1701.dll", EntryPoint = "LIVESCAN_GetFPRawData", CallingConvention = CallingConvention.Cdecl)]
unsafe public static extern int GetFPRawData(int nChannel, byte* pRawData);
unsafe
{
Byte[] bytes = new Byte[ * + ];
//就是固定“fixed 语句禁止垃圾回收器重定位可移动的变量”
fixed (byte* array = bytes)
{
Livescan.GetFPRawData(, array);
}
}

例2:

C++

extern "C" _declspec(dllexport) int Auto_Capture(BYTE *pBmpData)

C#

[DllImport("LivescanDll.dll", EntryPoint = "Auto_Capture", CallingConvention = CallingConvention.Cdecl)]
public static extern int Auto_Capture(Byte[] pBmpData);
Byte[] bytes = new Byte[ *  + ];
int result = Livescan.Auto_Capture(bytes);

Calling a C++ dll with unsigned char* parameters的更多相关文章

  1. C#封装C++DLL(特别是char*对应的string)

    1.新建一个C#-Windows-类库(用于创建C#类库(.dll)的项目)类型的工程 2.对于普通C++函数 XXXX_API void cppFun(int i); 在cs代码中添加 [DllIm ...

  2. c++unsigned char的输出问题

    unsigned char的范围是0~255,在用cout输出的时候要显示数字的话记得进行int的强制转化才可以,否则都是输出的字符,除此之外的所有比较转换成整数在做比较吧 除此之外,在最近的项目里由 ...

  3. unsigned char 类型

    在蓝牙4.0的开发中,很多数据类型都用到了 unsigned char ,我觉得用这个类型的一个原因是相比较于整型,它占的空间更少. 比如: unsigned char a = 1;  // 占1个字 ...

  4. char、unsigned char、BYTE

    首先uchar就是BYTE:Typedef unsigned char BYTE: char:就是signed char,是一个字节,8个位.第8位是符号位,所以可以表示-128~127共256个符号 ...

  5. unsigned char 无符号整形 减法运算

    对于一个字节来说: unsigned char :     0  ~  255              0000 0000  ~ 1111 1111 char :-128  ~  127       ...

  6. char, signed char, and unsigned char in C++

    关于这三者的区别stackoverrflow里有一个答案是这样说的: 3.9.1 Fundamental types [basic.fundamental] 1 Objects declared as ...

  7. unsigned char 转字符串:

    通常送显示的都是字符串,对于int long float转字符串有对应的函数,还有sprintf进行格式输出,对于嵌入式和单片机大多都用unsigned char型变量,转字符串需要自己编写函数,需要 ...

  8. signed char、unsigned char

    什么是无符号char类型?与常见的char类型有何不同? 在c++中有三种不同的字符类型:char,signed char,unsigned char.如果要应用与文本字符,就使用不加限制的char类 ...

  9. char 与 unsigned char的本质区别

    在C中,默认的基础数据类型均为signed,现在我们以char为例,说明(signed) char与unsigned char之间的区别 首先在内存中,char与unsigned char没有什么不同 ...

随机推荐

  1. UVa 10020 - Minimal coverage(区间覆盖并贪心)

    Given several segments of line (int the X axis) with coordinates [Li, Ri]. You are to choose the min ...

  2. ACCESS中类型操作(限制、转换)

    ACCESS如何保留两位小数 1.可以通过修改表结构中字段的“小数位数”即可. 2.可以通过“更新查询”,将所有该字段的值更新为round(字段名,2) ACCESS如何转换类型 每个函数都可以强制将 ...

  3. Oracle归档日志定时删除任务

    1.在Oracle账号下,创建归档日志删除文件del_arch.sh 文件位置:/home/oracle/crontabOra,内容如下: #!/bin/bash LOG_DIR=/home/orac ...

  4. Git之路——Git的使用

    centos6.6安装git2.4 第一安装编译环境: yum -y install zlib-devel openssl-devel perl cpio expat-devel gettext-de ...

  5. JLRoutes--处理复杂的URL schemes-备

    关键字:URL,URL schemes,Parse  代码类库:网络(Networking) GitHub链接:https://github.com/joeldev/JLRoutes   JLRout ...

  6. mysql的mvcc(多版本并发控制)

    mysql的mvcc(多版本并发控制) 我们知道,mysql的innodb采用的是行锁,而且采用了多版本并发控制来提高读操作的性能. 什么是多版本并发控制呢 ?其实就是在每一行记录的后面增加两个隐藏列 ...

  7. 转:Hprose for php(二)——服务器

    文章来自于:http://blog.csdn.net/half1/article/details/21252879 本文将介绍Hprose for php服务器的更多细节 1.发布服务 Hprose提 ...

  8. mobox:推进企业文档管理走向信息化之路

    随着“大数据”时代的到来,越来越多的人们对数据库管理信息抱有认可态度,这是近年来信息化发展的必然结果.企业作为推进社会经济发展的主力军,也必然要紧跟大数据时代潮流,利用计算机技术全面普及企业的信息化管 ...

  9. spring restful 中文乱码问题

    进行如下配置: @RequestMapping( value="/zzs/xgm", produces="application/json;charset=utf-8&q ...

  10. 【Hybrid App】一个产品经理眼中的PhoneGap Vs. AppCan

    首先在写这篇文章前,必须先申明一下,本人是技术出身,对HTML技术及手机客户端都有过编程经验,只是出于工作岗位的变动,便没有再具体代码工作,以下文章涉及的中间件的基本代码实现及前期的API使用,都是自 ...