Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: Default printer

$
0
0

The COBOL Link tab of the Properties Pages will only exist for native projects as managed code projects do not have a link step. When creating an executable for a native project, each separate program will cause as .obj file to be generated. These .obj files are then run through the system linker to generate an .EXE or .DLL. If the project is being converted from Net Express then it will be a native project, although you might also be generating .int/.gnt code instead of .obj. In managed code the source files are generated as IL code and an assembly is generated containing the compiled programs. Although these have the same extensions as native executables, .EXE/.DLL they are not the same.

To find the default printer in managed code you can use something like the following: For this to work you will have to have a reference to the System.Drawing assembly under Project References.

     $set ilusing"System.Drawing.Printing"
      program-id. Program1 as "testdefaultprinter.Program1".
      data division.
      working-storage section.
      procedure division.
          declare settings as type PrinterSettings = new PrinterSettings
          display settings::PrinterName
          goback.

      end program Program1.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>