question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Port System.Printing to C#

See original GitHub issue

System.Printing is currently a C++/CLI assembly. There would be advantages to rewriting it in C#, as detailed in this comment: https://github.com/dotnet/wpf/issues/5305#issuecomment-922067322 CC @ThomasGoulet73

I haven’t reviewed all the code in the project line-by-line. There is obviously some P/Invoke, some COM, and some native types in AsyncNotifyUnmanaged.cpp, which should make the port potentially complex, but not impossible.

Are there critical blocking issues that would make a port to C# impossible? What are the reference cycles related to System.Printing and would those still exist following a C# port?

Or is this primarily about the effort of rewriting thousands of lines of C++/CLI in C#?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
bgraingercommented, Jun 7, 2022

FWIW, in my mind this would be a line-by-line port (by hand) of each file, preserving the existing comments and semantics exactly as they are in the C++/CLI. (Any deviation from the C++/CLI behaviour in the port would be considered a bug.) This would provide a base upon which bug fixes, optimisations, etc. could be made.

1reaction
kant2002commented, Jun 7, 2022

Would be good if some test application/test was written or collected, because that rewrite should be tested not only manually, but also on working code. That will helps a lot with surpise issues later on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessing the Printer in C | C For Dummies Blog
All printing is now managed by the operating system. In Linux, while the printer might be accessible as a file located in the...
Read more >
printing to usb port - C Board - Cprogramming.com
Is it possible to access a printer attached to a usb port. Have tried the usual way:- FILE *prn_ptr; if((fp_ptr = fopen(prn_ptr,"LPT1"))==NULL)
Read more >
PrintPort Class (System.Printing)
Represents a printer port on a print server. Each print queue has a print port assigned to it.
Read more >
How can I connect a C program to a Printer?
There are several ways to connect a C program to a printer: 1. Using the operating system's printing API: Most operating systems, such...
Read more >
Using a USB printer with C#, with and without driver or API
It provides direct access to USB devices, like printers. ... Make sure you know how your printer interprets data, written from the usb...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found