durs / node-activex

Node.JS Implementaion of ActiveXObject

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ActiveX.Object is not a constructor

952185530 opened this issue · comments

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");`
}
}

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