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

Converting JavaScript string to C++ BSTR #13

Closed
k0ff33 opened this issue Jul 29, 2017 · 4 comments
Closed

Converting JavaScript string to C++ BSTR #13

k0ff33 opened this issue Jul 29, 2017 · 4 comments

Comments

@k0ff33
Copy link

k0ff33 commented Jul 29, 2017

Hi, I have a ActiveX property that takes in BSTR as an argument that doesn't seem to work properly in node-activex.

Docs:

NvrFromIpAddress  ([in] BSTR IpAddress) [get]
Property to get an NVR by IP Address.

NodeJS:

let nvr = myAutom.Nvrs.NvrFromIpAddress['192.168.1.9'] // returns undefined

C#:

var nvr = myAutom.Nvrs.NvrFromIpAddress["192.168.1.9"]; // returns nvr object

Any ideas? I've tried couple other functions/properties that take BSTR as an argument and none work correctly.

@durs
Copy link
Owner

durs commented Jul 30, 2017 via email

@k0ff33
Copy link
Author

k0ff33 commented Jul 30, 2017

I've tried that as well and returns:

Error: DispInvoke: NvrFromIpAddress Member not found.

But it's clearly there:
image

BTW, similar function/property:

Item  ([in] long Index) [get]
Property to get an NVR by index.

When called with square brackets runs fine, but fails as a JS function with round brackets:

let nvrOne = myAutom.Nvrs.Item[1] // returns nvr object
let nvrOne = myAutom.Nvrs.Item(1) // throws Error: DispInvoke: Item Member not found.

@durs
Copy link
Owner

durs commented Jul 31, 2017

Try new 1.0.3 version with property get fix

@k0ff33
Copy link
Author

k0ff33 commented Jul 31, 2017

Thank you so much @durs, works perfectly! 😃

@k0ff33 k0ff33 closed this as completed Jul 31, 2017
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