Closed LauraWebdev closed 1 year ago
I'm not able to recreate this on a fresh install of Windows 11 (latest version, all updates applied). Is this perhaps related to your messageHandler.RegisterWebMessageReceivedHandler
?
I tested with a the .NET sample from the sample project that I updated to Photino 2.4.0:
https://github.com/tryphotino/photino.NET/assets/3707196/19ce3cf7-e106-48f3-a18c-b3aacdb872e5
Is it required to be used within the Handler? I've tried to call it on the created window object after initialization.
I wanted to display an error message before calling window.load. See: https://github.com/LauraWebdev/client-next/blob/main/SpinShareClient/Program.cs#L31 (I've previously had this instance lock on Line 60 after initializing window)
I can confirm that ShowOpenFolder does work within the MessageHandler as used in https://github.com/LauraWebdev/client-next/blob/main/SpinShareClient/MessageParser/CommandLibrarySelectPath.cs (Which is just my abstraction layer for communication but is run within the handler.)
I'm running on a fairly new Win11 22621.1848 build.
Yes, since it needs to be called after the window.WaitForClose()
method was called which initialized the native window object and loads the window into memory. Before that the reference will not be able to point to a correct location in memory.
You're trying to prevent the user opening multiple instances of the application if I read everything correct?
Yes that's the idea. I want to give visual feedback that there can't be more than one instance open.
I added a ticket to the native project with that functionality as an enhancement since that would be the only place I can currently think of where we can open a native dialog without having to reference the window. For now you should be able to get away with sending a message after the page loads and close the second instance programmatically.
Hey there, I've just updated to 2.4.0 and wanted to check out the new native dialogs. When trying to test out ShowMessage, I receive an AccessViolationException.
And then later on:
The full exception is the following:
I can confirm that
window
holds a valid PhotinoWindow at this point. I am running this on the latest release Windows 11. I have not loaded a URL into the window at that point since I want to use the native dialog to show an error message when it would prevent the application from running.