Highlighted
Absent Member.
Absent Member.
935 views

[archive] New desktop no printers are assigned runtime aborts

[Migrated content. Thread originally posted on 20 August 2009]

Problem:
We have a nagging problem when our clients install a new desktop, laptop etc to the network and start our application.

Our startup programs first step is to issue the following:

CALL "WIN$PRINTER" USING
WINPRINT-GET-NO-PRINTERS
WINPRINT-SELECTION
GIVING CALL-RESULT.

Then search the default printer and place this printer name onto the status bar.

The problem with this call is that it assumes there have been printers added under the windows "printers and faxes" area.

Well, if infact there are no printers assigned the Acuruntime aborts with a memory access violation and terminates.

My question is, is there a way to first check to see if there are any printers out there before I issue this call, so we don't get the Memory Access violation and I could submit our own message with aborting ?

Thank you;
Alex
0 Likes
5 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] New desktop no printers are assigned runtime aborts

read the registry 🙂

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers
for every Printer is a Folder

David
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] New desktop no printers are assigned runtime aborts

Thank you I will check that out, also, Acucorp says this has been fixed in 8.0, I am going test with our 8.1.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] New desktop no printers are assigned runtime aborts

Thank you all out there for your assistance, and for your knowledge base version 8.0 and above handles the situation just fine.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] New desktop no printers are assigned runtime aborts

read the registry 🙂

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers
for every Printer is a Folder

David



When I look at that folder, I only see printers connected to the local machine. What about clients that have a network printer defined or not?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] New desktop no printers are assigned runtime aborts

hmmm funny, i get all printers in this location 🙂

whats about
HKEY_CURRENT_USER\Printers\Connections
in this location i only get my Network Printer

or check
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts
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.