Highlighted
Absent Member.
Absent Member.
3943 views

I get this error I can't figure out what is wrong

Jump to solution

I attached  the error in a text file

does anyone know what this error means

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Hey! It worked cool

thanks again now maybe I can do some reports

View solution in original post

0 Likes
12 Replies
Highlighted
Absent Member.
Absent Member.

Hi

Error tells about  File mentioned "LPT1" is not handled well.

Thanks

Cheeta

0 Likes
Highlighted
Absent Member.
Absent Member.

that's the printer port isn't it why won't my program work its suppose to print to the printer

0 Likes
Highlighted
Absent Member.
Absent Member.

I know you probably need to see my code if need to

0 Likes
Highlighted
Absent Member.
Absent Member.

Yes and How you are running the program

0 Likes
Highlighted
Absent Member.
Absent Member.

what do you mean

0 Likes
Highlighted
Absent Member.
Absent Member.

here's the code

0 Likes
Highlighted
Absent Member.
Absent Member.

sorry my computer jargon ain't that great

it's a console app using a dat file

0 Likes
Highlighted
Absent Member.
Absent Member.

Did you define a printer share?  

Something like (Admin rights needed for Win7)

 NET USE LPT1: \\ComputerName\PrinterShareName

To test:    copy someTextFile.txt LPT1

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

You need to add the run-time tunable printer_redirection=true in order for the priint output to be redirected through the Windows print spooler.

I am assuming that this is a managed code application as the error that you are receiving is a .NET exception.
In a managed project you can turn this tunable on by adding a section to an app.config file.

If you right-click on your project name-->select add-->new item and select Application Configuration file from the list.

Edit the app.config file to add the run-time tunable as show in the following docs.

Format for a Configuration File for .NET COBOL

The first key in the example is the required one:

add key="printer_redirection" value="true"

The second key is optional and provides a method of changing the default font name and size.

Thanks

0 Likes
Highlighted
Absent Member.
Absent Member.

Configuration system failed to initialize

Unrecognized configuration section MicroFocus.COBOL.Application/Interop. (c:\use

rs\titor\documents\visual studio 2010\projects\phoneadd\phoneadd\bin\debug\Phone

Add.exe.Config line 21)

Unhandled Exception: COBOLFileHandlingException

'LPT1' : 9/004 (ANS74)

 4     Illegal file name

at Void  PHONEADD._MF_PERFORM_4_0() in c:\users\titor\documents\visual studio 2

010\Projects\PhoneAdd\PhoneAdd\Program1.cbl:line 52

at Int32  PHONEADD.PHONEADD() in c:\users\titor\documents\visual studio 2010\Pr

ojects\PhoneAdd\PhoneAdd\Program1.cbl:line 43

at Int32  PHONEADD._MF_ENTRY()

Press any key to continue . . .

I'm getting this error now

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

It sounds like a copy/paste error modifying the config file

I am attaching a demo project that uses your code and works with the app.config file set.

Thanks.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.