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

WinUI for Desktop #4375

Closed
Fernand-Delavy opened this issue Feb 28, 2021 · 7 comments
Closed

WinUI for Desktop #4375

Fernand-Delavy opened this issue Feb 28, 2021 · 7 comments
Labels
duplicate This issue or pull request already exists

Comments

@Fernand-Delavy
Copy link

i use Visual Studio 16.9.0.Preview 5.0

App can't print because crash:
PrintManager manager;
manager = PrintManager.GetForCurrentView(); // System.Runtime.InteropServices.COMException: 'Interface non enregistrée (0x80040155)'
The print capability is important

Can't change Windows title from 'WinUI Desktop' to app name

MessageDialog crash work arond use ContentDialog ?

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Feb 28, 2021
@sigmarsson
Copy link

Yes ContentDialog.

@StephenLPeters
Copy link
Contributor

@Austin-Lamb FYI. @Fernand-Delavy I haven't seen PrintManager before, but the api's that have *ForCurrentView() generally use the core window, which isn't supported in Winui3 preview 4. I don't know if this has another way to do it or not.

@StephenLPeters StephenLPeters added appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps version-winui3preview4 WinUI 3 Preview 4 issues team-Reach Issue for the Reach team product-winui3 WinUI 3 issues labels Mar 3, 2021
@bpulliam bpulliam removed the needs-triage Issue needs to be triaged by the area owners label Oct 8, 2021
@dedaap72
Copy link

dedaap72 commented Nov 28, 2021

I'm running into the same problem in WinUI3. How do I get printing to work? All examples I Google use UWP.
This issue links to #4363 which links back to this issue, which is not very helpful either...

@Fernand-Delavy
Copy link
Author

Sorry for my bad englich

I think here is a "Wirte Only" forum. All developper write but the Microsoft Staff (GitHub) never reply !
My post is 9 month old and no solution !

@StephenLPeters
Copy link
Contributor

@MikeHillberg and @codendone FYI

@ezexe
Copy link

ezexe commented Apr 13, 2022

so no solution?

@krschau krschau added duplicate This issue or pull request already exists and removed team-Reach Issue for the Reach team product-winui3 WinUI 3 issues appModel-win32 Exclusive to WinUI 3 Win32 Desktop apps version-winui3preview4 WinUI 3 Preview 4 issues labels Jun 15, 2022
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jun 15, 2022
@krschau
Copy link
Contributor

krschau commented Jun 15, 2022

Please try the solution in the sample app linked in #7234.

Essentially, as mentioned above, *ForCurrentView() methods don't work in WinUI 3 desktop apps, which don't have a core window. But you can work around it with an hwnd and the interop method:

var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(this);
printMan = PrintManagerInterop.GetForWindow(hWnd);
await PrintManagerInterop.ShowPrintUIForWindowAsync(hWnd)

I'm closing this as a dupe of #4419, and any more conversation can happen over there.

@krschau krschau closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2022
@ghost ghost removed the needs-triage Issue needs to be triaged by the area owners label Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

7 participants