drl47263 2016-10-02 04:09
浏览 139

是否可以在nodejs或golang中使用Visual C ++ MFC函数附加组件?

Currently, I have some visual c++ function using MFC. Can I use this functions as c++ addons in nodejs or golang?

To be specific, I need to somehow access to the OCX (ActiveX) object through my golang or nodejs code. So, I decided to write down the add-on using c++, but found it really difficult without using MFC/ATL things. So, can I use these MFC/ATL functions as addon/extension in nodejs or golang? Thanks!

  • 写回答

1条回答 默认 最新

  • douganmo1121 2016-10-02 06:05
    关注

    You can call ATL/MFC code from your addon C++ code but you cannot tie to ATL/MFC directly from nodejs/golang without your intermediate wrapper layer.

    Note: either node-ffi for nodejs or cgo for golang are useful for integration with native code but will not help to call ATL/MFC directly just because both node-ffi and cgo target C calling convention (all C++ code has to be wrapped with extern "C" to be callable via node-ffi/cgo). So you still need to create C++ wrapper around ATL/MFC. Also when creating your addon/extension ensure ATL/MFC exceptions (or any other C++ exceptions) do not cross module boundaries.

    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置