durs / node-activex

Node.JS Implementaion of ActiveXObject
MIT License
329 stars 62 forks source link

ActiveX.Object is not a constructor #109

Open 952185530 opened 2 years ago

952185530 commented 2 years ago

import winax from "winax" function getDM() { try { console.log(global.ActiveXObject)

return new ActiveXObject("dm.dmsoft"); } catch (e) { try { execSync(regsvr32 ${path.join(process.cwd(), 'src/dll/dm.dll')}); } catch (e) { // fix electron not work execSync( `regsvr32 ${path.join(process.cwd(), 'src/dll/dm.dll' )}`` ); } return new ActiveXObject("dm.dmsoft");` } }

952185530 commented 2 years ago

The console output this error : ActiveX.Object is not a constructor。 I know what this error means, but I don't know how it happened. I just imported the dependency and new to instantiation。 My project use Vue2.0, Typescript and Electron