Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DispInvoke: XXX Error #128

Open
minkee-lee opened this issue Jun 19, 2023 · 1 comment
Open

DispInvoke: XXX Error #128

minkee-lee opened this issue Jun 19, 2023 · 1 comment

Comments

@minkee-lee
Copy link

minkee-lee commented Jun 19, 2023

(Maybe this is not an issue, just a question.)

I made tutorial OCX using visual studio 2015 (using MFC ActiveX Control project).
And try testing with winax like following .. and got error.

This is my code
(The function AboutBox() of tutorial OCX just shows an about window.)

var con = new ActiveXObject("MFCACTIVEXCONTRO.MFCActiveXControCtrl.1");
console.log(con)
con.AboutBox();

and npm start result in...

<ref *1> [Function: undefined] Dispatch {
  [__vars]: {},
  [__methods]: {
    AboutBox: { name: 'AboutBox', dispid: -552, invkind: 1, flags: 0, argcnt: 0 }
  },
  [__type]: [
    { name: 'AboutBox', dispid: -552, invkind: 1, flags: 0, argcnt: 0 }
  ],
  [__value]: [Circular *1],
  [__id]: 'MFCACTIVEXCONTRO.MFCActiveXControCtrl.1'
}
(node:55900) UnhandledPromiseRejectionWarning: Error: DispInvoke: AboutBox 오류입니다.

    at Dispatch.<anonymous> (<anonymous>)

I think OCX loaded well but something wrong with function call..

But another built-in(?) OCX success.

  var whs = new ActiveXObject("WScript.Shell");
  whs.Popup("hello");  // It shows a popup correctly.

Any help.. would be great
Thanks in advance.

More test)
Calling my OCX in visual studio MFC project ... works correct.

(Calling an AboutBox() shows about dialog well.)
image

@durs
Copy link
Owner

durs commented Jun 19, 2023

For initialization OCX (ActiveX Control) requires a window subsystem, message queue processing etc.
NodeJS does not provide this. Only simple ATL Object/MFC Class/COM Automation Object can be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants