You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var printer = require('./api/printer')
printer.init('yaphone', function(err, result) {
if (err) throw err
console.log(result)
})
printer.sayHello('', function(err, result) {
if (err) throw err
console.log(result)
})
printer.sayGoodbye('', function(err, result) {
if (err) throw err
console.log(result)
})
I try to run node index.js, and I got output in the console like this:
yaphone
Hello,
Goodbye,
But, my expect output is this:
yaphone
Hello, yaphone
Goodbye, yaphone
I suspect this is related to the life cycle of the dll, because I load the dll three times in node. So, how can I load once, and use the three methods in the dll?
Thx for any replies!
The text was updated successfully, but these errors were encountered:
I am looking at using Edge and wanted to see what kind of defects it has.
Looks like the project might be dead (not updated for 2 years).
I noticed your question, but it looks like you are expecting a bunch of async function to behave as if they were sync. What if you await for your init to complete?
I am looking at using Edge and wanted to see what kind of defects it has.
Looks like the project might be dead (not updated for 2 years).
I noticed your question, but it looks like you are expecting a bunch of async function to behave as if they were sync. What if you await for your init to complete?
THX for your reply. I was a fresher when I ask this question, and I use edge in a wrong way. I write a dll with C#, and I need to use in my electron program, so at last I use 'electron-edge-js'.
In my program, I need to init something like the ca cert and the environment, finally, I write two dlls, electron-edge-js call the first dll, and the first dll call the second to do the init function.
Hello, I am a newer of edge-js, I create a C# dll project, source code as bellow:
And I got the dll file, put it in my node project, then create an api.js like this:
Finally, I create an index.js like this:
I try to run
node index.js
, and I got output in the console like this:But, my expect output is this:
I suspect this is related to the life cycle of the dll, because I load the dll three times in node. So, how can I load once, and use the three methods in the dll?
Thx for any replies!
The text was updated successfully, but these errors were encountered: