是否可以在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!

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.