Skip to main content

[archive] New desktop no printers are assigned runtime aborts

  • August 21, 2009
  • 5 replies
  • 0 views

[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

5 replies

[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
read the registry :)

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

David

[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
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.

[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
Thank you all out there for your assistance, and for your knowledge base version 8.0 and above handles the situation just fine.

[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
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?

[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
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