1

是否可以使用js-ctypes调用 Windows DLL 并让它返回一个 nsISupports 实例?Windows DLL 执行 XPCOMGlue,但不需要 NSModule,我希望我可以改进注册过程。我希望定义了一个 ctypes.nsISupports 类型用作返回值,所以如果可能的话,我该如何声明调用?

4

1 回答 1

1

From my reading and experimentation, no, it doesn't look like you can. However, you could do the next best thing.

1. Create a win32 DLL exporting plain "C" symbols.

2. Create a "wrapper" XPCom component using JavaScript.

http://kb.mozillazine.org/Implementing_XPCOM_components_in_JavaScript

3. Plumb each plain "C" function exported by the DLL into the JavaScript object.

Possible improvement: create a generic JavaScript shim that does the plumbing automatically.

于 2013-08-29T05:35:01.877 回答