Hi Roberto,
How do I know what sFilePath is? Is that the path to the executable that will run the .pdf or .xfdf file? In which case I would need to know where Acrobat Reader is located to pass it. If I know that, then I can use createprocess instead and waitforsingleobject works as it should. I've tested using createprocess with adobe acrobat reader and it opens the xfdf as it should but the problem is that I do not know where Acrobat Reader is located on the workstation's harddrive (or network). I am trying with shellexecute because I do not know if AcrobatReader is installed and if so what version and where it is located...
>Tracy, recapturing thread of CreateProcess... I'm insist with find application related with extension.
>
>Try with this.
>
>
>DEFINE CLASS RunFiles AS Custom
>
> PROCEDURE RunFileNoEXE( sFilePath )
> SET PROCEDURE TO "C:\.........\samples\classes\registry.prg"
> oReg = CreateObject("FileReg")
>
> *|-- File extension
> m.cExtn = JUSTEXT( sFilePath )
>
> nErrNum = oReg.GetAppPath(m.cExtn,@cAppKey,@cAppName)
> IF m.nErrNum # ERROR_SUCCESS
> MESSAGEBOX(C_EXTNOFOUND_LOC)
> RETURN
> ENDIF
>
> IF ATC(".EXE",m.cAppName) #0
> m.cAppName= ALLTRIM(SUBSTR(m.cAppName,1,ATC(".EXE",m.cAppName)+3))
> IF ASC(LEFT(cAppName,1))=34 &&check for long file name in quotes
> m.cAppName = SUBSTR(m.cAppName,2)
> ENDIF
> ENDIF
>
> *|-- Run REAL App, with file name parameter
> llacordok = RunAndWait( m.cAppName, '61NC.XFDF', 'C:\FOXPRO\VFP8' )
> IF !llacordok
> =MESSAGEBOX("Unable to print Acord Form.",0+16+4096,"ERROR")
> ELSE
> WAIT WINDOW "Finished Printing" NOWAIT
> ENDIF
> ENDPROC
>ENDDEFINE
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"