How to use PostMessage and BindObjectAsync in the same function #4404
Replies: 2 comments 2 replies
-
Registering an object is expensive and is not really meant to be used in a dynamic register/unregister fashion. There's caching in the render process for performance reasons. I'd suggest using ResolveObject event to instead. Just register your object once. Without a complete example it's impossible to know what's going on.
Whilst you can, you typically wouldn't mix and match. For There's a basic example at #2775 (comment) and a unit tests at https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Test/PostMessage/PostMessageTests.cs#L39 |
Beta Was this translation helpful? Give feedback.
-
Hi @amaitland, thanks for your reply but I have more concern What I want is: Using
C# CODE
What is problem: Now, I'm using the above code and can not get new message when run |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a button on web and when clicking it will send data to my WPF app. What I want is after processing with that data, WPF will send result to web. Currently, I use CefSharp.PostMessage to push message from web to WPF and handler JavascriptMessageReceived event to received message. Then I use that data to calculate and register JavascriptObjectRepository to send result to web after process ending. But the app always get error Uncaught (in promise) ReferenceError: bindingObj is not defined in JS at
var result= bindingObj.getResult();
when I click button in web. Anyone has solution? ThanksNote: I use Cefsharp ver 109.1.100 and net7
Beta Was this translation helpful? Give feedback.
All reactions