看看libMesaSR.dll的导出函数:


遇到的问题:

error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int

解决:

HWND等未定义

解决:

#include <windows.h>


包含头文件:

  1. definesSR.h
  2. libMesaSR.h

链接时的依赖输入

  1. libMesaSR.lib
  1. /*
  2. * =====================================================================================
  3. *
  4. * Filename: main.cpp
  5. * Environment:
  6. * Description: SR4K的API使用(libMesaSR.dll)
  7. *
  8. *
  9. * Version: 1.0
  10. * Created: 2013/10/30 20:47:31
  11. * Author: yuliyang
  12. I*
  13. * Mail: wzyuliyang911@gmail.com
  14. * Blog: http://www.cnblogs.com/yuliyang
  15. *
  16. * =====================================================================================
  17. */
  18.  
  19. #include "definesSR.h"
  20. #include "libMesaSR.h"
  21. #include <stdio.h>
  22. int main(){
  23.  
  24. /*-----------------------------------------------------------------------------
  25. * 设备通过网络连接,局域网内只有一台设备,没有设置IP。
  26. *
  27. *-----------------------------------------------------------------------------*/
  28. CMesaDevice *cam=NULL;
  29. SR_OpenDlg(&cam,,NULL); /* 自动通过局域网连接设备 */
  30. /*-----------------------------------------------------------------------------
  31. * 获取行和列
  32. *
  33. *-----------------------------------------------------------------------------*/
  34. int r= SR_GetRows(cam);
  35. int c= SR_GetCols(cam);
  36.  
  37. /*-----------------------------------------------------------------------------
  38. * 指向3D数据的指针
  39. *
  40. *-----------------------------------------------------------------------------*/
  41. float *x=NULL;
  42. float *y=NULL;
  43. float *z=NULL;
  44. x=(float *)malloc(r*c*sizeof(float));
  45. y=(float *)malloc(r*c*sizeof(float));
  46. z=(float *)malloc(r*c*sizeof(float));
  47. printf("r=%d,c=%d\n",r,c);
  48. //SR_StreamToFile(cam,"1.dat",0);
  49. /*-----------------------------------------------------------------------------
  50. * 照相机获取图像并且传输到主机
  51. *
  52. *
  53. *-----------------------------------------------------------------------------*/
  54. int num=SR_Acquire(cam);
  55. printf("the number of transfered bytes :%d\n",num); /* 传输的字节数 */
  56. //SR_StreamToFile(cam,"1.dat",2);
  57. /*-----------------------------------------------------------------------------
  58. * 发现数据1.dat是乱码的
  59. *
  60. *-----------------------------------------------------------------------------*/
  61. /*SR_GetImage(cam,0);
  62. SR_CoordTrfFlt(cam, x, y, z, sizeof(float) , sizeof(float) , sizeof(float));*/
  63.  
  64. /*-----------------------------------------------------------------------------
  65. * 释放内存
  66. *
  67. *
  68. *-----------------------------------------------------------------------------*/
  69. SR_Close(cam) ;
  70. free(x); //free allocated buffers
  71. free(y);
  72. free(z);
  73. return ;
  74. }

结果:

144*176*4=101376字节

SR4K的API使用(libMesaSR.dll)的更多相关文章

  1. C#中可直接调用WIN32的API函数--USER32.DLL

    Win32的API函数可以直接在C#中直接调用,在做WinForm时还是很有帮助的.有时候直接调用Win32的API,可以很高效的实现想要的效果. using System; using System ...

  2. Windows API学习---插入DLL和挂接API

    插入DLL和挂接API 在Microsoft Windows中,每个进程都有它自己的私有地址空间.当使用指针来引用内存时,指针的值将引用你自己进程的地址空间中的一个内存地址.你的进程不能创建一个其引用 ...

  3. Windows Dll Injection、Process Injection、API Hook、DLL后门/恶意程序入侵技术

    catalogue 1. 引言2. 使用注册表注入DLL3. 使用Windows挂钩来注入DLL4. 使用远程线程来注入DLL5. 使用木马DLL来注入DLL6. 把DLL作为调试器来注入7. 使用c ...

  4. nodejs利用windows API读取文件属性(dll)

    nodejs调用delphi编写的dll中,使用了dll调用windows api转读取文件属性,感觉使用nodejs也可直接调用windows api. 此处需用到windows系统的version ...

  5. C#调用Win32 的API函数--User32.dll ----转载

    Win32的API函数是微软自己的东西,可以直接在C#中直接调用,在做WinForm时还是很有帮助的.有时候我们之直接调用Win32 的API,可以很高效的实现想要的效果. using System; ...

  6. PowerShell-4.API调用以及DLL调用

    PowerShell可以直接调用API,So...这东西完全和cmd不是一回事了... 调用API的时候几乎和C#一样(注意堆栈平衡): 调用MessageBox: $iii = Add-Type - ...

  7. 【转】c# 调用windows API(user32.dll)

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.R ...

  8. 【整理】c# 调用windows API(user32.dll)

    User32.dll提供了很多可供调用的接口,大致如下(转自http://blog.csdn.net/zhang399401/article/details/6978803) using System ...

  9. Native Application 开发详解(直接在程序中调用 ntdll.dll 中的 Native API,有内存小、速度快、安全、API丰富等8大优点)

    文章目录:                   1. 引子: 2. Native Application Demo 展示: 3. Native Application 简介: 4. Native Ap ...

随机推荐

  1. linux (centos 6.4)安装自定义分区方案(转载)

    在计算机上安装 Linux 系统,对硬盘进行分区是一个非常重要的步骤,下面介绍几个分区方案. 方案 1 / :建议大小在 5GB 以上. swap :即交换分区,建议大小是物理内存的 1~2 倍. 方 ...

  2. 一些浏览器HACKS

    1.选择器HACKS /*IE6及以下*/            *html #uno{...} /*IE7*/                    *:first-child+html #dos{ ...

  3. iOS应用数据存储的常用方式

    iOS应用 数据存储的常用方式 XML属性列表 plist Preference 偏好设置 NSKeyedArchiver 归档 Core Data SQLite3 应用沙盒: Layer:     ...

  4. Android 之 悬浮窗

    昨天研究Android的悬浮窗,遇到一个问题,研究了一天,总算找到结症了,原因非常坑人..... 问题是这样的,我想要将悬浮窗展现在桌面或其他应用之上,我的开发机子用的是MIUI,结果发现在机子上无论 ...

  5. cocos2d-x学习笔记------动画人物跑起来吧!

    学习总结: 1.sprintf用来格式化字符串 2.CCSpriteFrame:: frameWithTexture通过图片名创建的时候需要的参数Texture2D创建使用CCTextureCache ...

  6. Linux下GPIO驱动(四) ----gpio_request();gpio_free();

    //gpio_request申请gpio口 int gpio_request(unsigned gpio, const char *label) { struct gpio_desc *desc; s ...

  7. PythonCrawl自学日志(4)

    2016年9月22日10:34:02一.Selector1.如何构建(1)text构建: body = '<html><body><span>good</sp ...

  8. VS调试错误:“没有可用于当前位置的源代码”的解决方案

    今天,有朋友在问为什么我在调试的时候会出现"没有可用于当前位置的源代码"的错误呢? MSDN上的说法:没有可用于当前位置的源代码,项目不包含您试图查看代码的源代码.原因通常是双击了 ...

  9. python 常用模块(转载)

    转载地址:http://codeweblog.com/python-%e5%b8%b8%e7%94%a8%e6%a8%a1%e5%9d%97/ adodb:我们领导推荐的数据库连接组件bsddb3:B ...

  10. Delphi XE10让android的界面设计摆脱繁杂

    设计一个选项卡. 大体图样: 1.创建一个multi_Device_Application;2.在form上放一个Rectangle1,设置align为top.设置fill属性的kind为Gradie ...