SHELLEXECUTE(

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
andyglezl
Posts: 1149
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 68 times
Contact:

SHELLEXECUTE(

Post by andyglezl » Fri May 10, 2013 12:41 am

Hola de nuevo

Estoy utilizando el "SHELLEXECUTE" para abrir un archivo .PDF que genero;
en Win XP funciona correctamente de las siguientes 2 formas:

SHELLEXECUTE( 0, "open" , cNomArc )
SHELLEXECUTE( 0, "open" , "AcroRd32.exe", cNomArc )

Pero en Win7 y Win8 no hace NADA.

Alguna idea de porque ? Gracias.

P.D. Ya está instalado el Acrobat y asociada la extencion.
------------------------------------------------------------------------

Hello again

I am using the "ShellExecute" to open a .PDF file;
in Win XP works correctly in the following two ways:

ShellExecute (0, "open", cNomArc)
ShellExecute (0, "open", "AcroRd32.exe" cNomArc)

But in Win7 and Win8 does NOTHING.

Any idea why? Thank you.

P. D. Already installed the Acrobat and associated the extension.
Andrés González López
Desde Guadalajara, Jalisco. México.

User avatar
danielmaximiliano
Posts: 2118
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 145 times
Been thanked: 20 times
Contact:

Post by danielmaximiliano » Fri May 10, 2013 1:02 am

Hola Andres :
En Windows 7 Home Premium 64 funciona con este codigo.

Code: Select all

#Include 'hmg.ch'
Function Main
 REQUEST HB_GT_WIN_DEFAULT
 ShellExecute (0, "open", "AcroRd32.exe" , "Armado Cables Fiscales.pdf" )

Return
probe y funciona correctamente
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
andyglezl
Posts: 1149
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 68 times
Contact:

Post by andyglezl » Fri May 10, 2013 3:53 pm

Gracias Max

Voy a revisar que es lo que puede ser, ya que son 2 maquinas diferentes
una con Win7 Prof. y otra con Win8 y en ninguna funciona dentro del programa,
sin embargo si me voy al explorador y le doy click a un archivo PDF, lo abre
correctamente en ambos.
Andrés González López
Desde Guadalajara, Jalisco. México.

Carlos Britos
Posts: 220
Joined: Sat Aug 02, 2008 5:03 pm
Has thanked: 6 times
Been thanked: 2 times

Post by Carlos Britos » Fri May 10, 2013 11:22 pm

andyglezl wrote:Gracias Max

Voy a revisar que es lo que puede ser, ya que son 2 maquinas diferentes
una con Win7 Prof. y otra con Win8 y en ninguna funciona dentro del programa,
sin embargo si me voy al explorador y le doy click a un archivo PDF, lo abre
correctamente en ambos.
Hi
Try getting the return value of shellExecute()

Code: Select all

ERROR_FILE_NOT_FOUND     The specified file was not found.
ERROR_PATH_NOT_FOUND     The specified path was not found.
ERROR_BAD_FORMAT         The .exe file is invalid (non-Microsoft Win32 .exe or error in .exe image).
SE_ERR_ACCESSDENIED      The operating system denied access to the specified file.
SE_ERR_ASSOCINCOMPLETE   The file name association is incomplete or invalid.
SE_ERR_DDEBUSY           The Dynamic Data Exchange (DDE) transaction could not be completed because other DDE transactions were being processed.
SE_ERR_DDEFAIL           The DDE transaction failed.
SE_ERR_DDETIMEOUT        The DDE transaction could not be completed because the request timed out.
SE_ERR_DLLNOTFOUND       The specified dynamic-link library (DLL) was not found.
SE_ERR_FNF               The specified file was not found.
SE_ERR_NOASSOC           There is no application associated with the given file name extension. This error will also be returned if you attempt to print a file that is not printable.
SE_ERR_OOM               There was not enough memory to complete the operation.
SE_ERR_PNF               The specified path was not found.
SE_ERR_SHARE             A sharing violation occurred.

Regards/Saludos, Carlos (bcd12a)

Post Reply