开发USB交互DLL [英] Developing a USB interaction DLL

查看:70
本文介绍了开发USB交互DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我的问题是你是否可以使用C ++制作USB通信DLL而无需导出类,只是使用静态方法。如果是,请提供代码或链接的示例。谢谢。

Hi. My question is whether you can make a USB communication DLL with C++ without exporting classes and just using static methods or not. If so then provide an example with code or link please. Thanks.

推荐答案

是的,你可以只导出函数而不导出类,但这确实是'C'方式而不是C ++方式。您是否在将类导入客户端或从DLL导出时遇到问题?无论如何这里''''C''样式函数从C ++ Windows DLL界面导出。



Yes you can export just functions and no classes but that''s really the ''C'' way not the C++ way. Are you having trouble importing the classes into the client or exporting them from DLL? anyway here''s a ''C'' style function export from a C++ Windows DLL interface.

//Myfile.cpp

extern "C"
{

  __declspec( dllexport ) int AVitalFunction( int iParameter )
  {
   //do important things...
  }

}


这篇关于开发USB交互DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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