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

DrawingSurface eexception on window close #468

Open
CarloAndreoli opened this issue Nov 30, 2024 · 1 comment
Open

DrawingSurface eexception on window close #468

CarloAndreoli opened this issue Nov 30, 2024 · 1 comment

Comments

@CarloAndreoli
Copy link

CarloAndreoli commented Nov 30, 2024

C#, .Net8.0, WPF application.

I have a window A which open a new window B. Window B display and correctly work using DrawingSurface. When I try to close window B, from window A or directly from the close button of window B, I get an error.

Error occur in DrawingSurface method EndD3D() because the _deviceContext is null.

Sample here:
I cant provide the whole code but this sample perfectly repoduce the problem. Run the application, click on open button then close the secondary window.
VorticeTest.zip

ps thanks for your work

@h1cks
Copy link
Contributor

h1cks commented Dec 1, 2024

I suggest you create an unattached context you render to and bitmap copy across to each window. Rather than directly linking to the window directly in dx. That was the approach I have used on MDI

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