Re: The calling thread cannot access this object because a different thread owns it.
Posted: 14 Apr 2021, 08:35
Hi sfernandez,
Is that it is not yet supported in C++ SDK 3.0.11? I don't see the Invoke() in NoesisSDK/Include/NsGui/DispatcherObject.h
And also in UE, when I run this snippet under a custom handler named `OnInitialized()`, which is bound to FrameworkElement::Initialized event:
, it just crashed and raises the error:
LogNoesis: Warning: The calling thread (7368) cannot access this Boxed<String> because a different thread (0) owns it
Is that it is not yet supported in C++ SDK 3.0.11? I don't see the Invoke() in NoesisSDK/Include/NsGui/DispatcherObject.h
And also in UE, when I run this snippet under a custom handler named `OnInitialized()`, which is bound to FrameworkElement::Initialized event:
Code: Select all
class CustomUIControl: public Noesis::UserControl
{
bool ConnectEvent(Noesis::BaseComponent* source, const char* event, const char* handler) override
{
NS_CONNECT_EVENT(Noesis::Button, Initialized, OnInitialized);
return true;
}
virtual void OnInitialized(Noesis::BaseComponent* InSender, const Noesis::EventArgs& InEventArgs) override
{
Noesis::Button* button = Noesis::DynamicCast<Noesis::Button*>(InSender);
verify(button);
button->VerifyAccess();
button->SetContent("Ok"); -> It crashes here!
}
};
LogNoesis: Warning: The calling thread (7368) cannot access this Boxed<String> because a different thread (0) owns it