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