Power Builder - regedit

 
Vista:

regedit

Publicado por CRISTIAN FERRERO (27 intervenciones) el 30/10/2001 22:33:18
Ricardo: cheka lo que encontre de cambiar la registry,,,,\"These methods of updating the registry to change the printer that PB uses is
obsolete and does not work. PB stores the default printer the first time
that it used/changed by the executable, then when printsetup() is used to
set a new printer that new printer is rememberd without going to the system
default printer. Changing the registry will change the system default
printer for every application, however it will appear to work only if you
never change the printer using the standard PB calls\".

Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:regedit

Publicado por Ricardo (1957 intervenciones) el 30/10/2001 23:33:45
Que version de PB tienes. Ya que yo lo probe con la version 6.0 y 7 ?

Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:regedit

Publicado por Ricardo (1957 intervenciones) el 31/10/2001 00:53:33
Sugerencia de Juan Mellado: SET DEFAULT PRINTER FROM WITHIN PB

/****** PARTE 1 / 3

Remember that the printer you dynamically change to must already be configured on that system. Win95 requires an extra step to setting a new default printer.
/******************************************************************
/*******Variable Explaination:
li_rtn = Return code to verify if the WIN.INI update succeeded.
ls_default = String variable that contains the default printer name.
ls_driver = String variable that holds the printer's driver.
ls_port = String variable that holds the printer's port.
ls_printer = String that will contain the concatenated printer's driver and port.
ls_key = String variable containing the registry path to the printer information.
Object Explaination:
sle_def = Single line edit that contains the default printer's name.
sle_def2 = Single line edit that contains the default printer's port and driver.
sle_new = Single line edit that contains the new printer's name.
sle_new2 = Single line edit that contains the new printer's port and driver.
*******************************************************************/
//********Variable declarations:
int li_rtn
string ls_default, ls_driver, ls_port, ls_printer, ls_key
/*******/STEP 1: Get the current default printer name.
RegistryGet("HKEY_LOCAL_MACHINE\Config\0001\System\CurrentControlSet\Control\Print\Printers", "default", ls_default)
sle_def.text = ls_default
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:regedit

Publicado por Ricardo (1957 intervenciones) el 31/10/2001 00:54:37
// ****** PARTE 2 / 3

//********STEP 2: Get the default printers driver and port.
ls_key ="HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ Print\Printers\"+sle_def.text
RegistryGet(ls_key, "Printer Driver", ls_driver)
RegistryGet(ls_key, "Port", ls_port)
sle_def2.text = ls_driver + "," + ls_port
//********STEP 3: Set a new default printer name.
int li_rtn
li_rtn =RegistrySet( & "HKEY_LOCAL_MACHINE\Config\0001\System\CurrentControlSet\Control\Print\Printers", "default", sle_new.text)
if li_rtn = 1 then
Messagebox("Setting new printer name", "Successful")
else
Messagebox("Setting new printer name", "Failed")
end if
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

3 / 3 Print

Publicado por Ricardo (1957 intervenciones) el 31/10/2001 00:55:55
//*******STEP 4: Get the new default printer's driver and port.
ls_printer = sle_new.text
ls_key = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\ Control\Print\Printers\" + ls_printer
RegistryGet(ls_key, "Printer Driver", ls_driver)
RegistryGet(ls_key, "Port", ls_port)
sle_new2.text = ls_driver + "," + ls_port
//*******STEP 5: Set the new default printer name, driver and port in the WIN.INI .
ls_printer = sle_new.text + "," + sle_new2.text
li_rtn = SetProfileString( "c:\windows\win.ini", "Windows", "device", ls_printer)
if li_rtn = 1 then
Messagebox("Win.ini Update", "Successful")
else
Messagebox("Warning", "An error has occurred")
end if

No me preguntes por que 3 de 3, ya que todo esto completo no lo podia publicar. UN SALUDO!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:3 / 3 Print

Publicado por CRISTIAN (27 intervenciones) el 31/10/2001 14:10:45
RICADO: Cambiar el registro, lo logro hacer, lo que no funciona (al menos en mi version PB 6.5) es que la datawindow se imprima en la nueva impresora que pongo en la registry.

Saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

HECHO!!!!

Publicado por CRISTIAN (27 intervenciones) el 31/10/2001 16:24:05
OK, RICARDO..LO HE LOGRADO...TE GANASTE UN AMIGO PARA CUANDO VISITES ARGENTINA.
MUCHAS GRACIAS!!!!!!!!!!!!!!!!!!!!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:HECHO!!!!

Publicado por Ricardo (1957 intervenciones) el 31/10/2001 17:10:44
Que Bueno que lo has logrado.

El exito ha sido tuyo.

Un saludo!!!!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:HECHO!!!!

Publicado por miguel (1 intervención) el 31/10/2001 18:48:38
Y en windows 2000??
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar