![]() ? "Unexpected Return, code=" & STR$(Stat) ? "Wait returned from " & lpVerb & " on Timeout" ? "Wait returned from " & lpVerb & " on process completion" ? "Wait Failed:" & SystemErrorMessageText (E) Stat = WaitForSingleObjectEx (hWaitProcess, Timeout2, 0) IF ISTRUE ShellExecuteEx(SEI) THEN ' function succeeded and returned SEI.hProcess = 0 ' will be updated by ShellExecuteEx SEI.lpIdList = %NULL ' here down to hprocess ignored unless appropriate mask included in fmask SEI.nShow = %SW_SHOW ' should be zero for a document file PER MSDN DOC. SEI.LpFile = lpFile 'varptr(args) 'VARPTR(lpFile) SEI.lpVerb = lpVerb 'varptr(gs) 'VARPTR(lpVerb) ' "statement expected," which is a useless error message. ' The error message if you use 'timeout' as a variable name is ' in the context of a TCP or UDP verb and can only be found with "search." LOCAL TimeOut2 AS LONG ' "timeout" is another un-hilited "reserved" word which is truly only reserved LOCAL lpVerb AS ASCIIZ * 20, lpParameters AS ASCIIZ * 20, lpDirectory AS ASCIIZ * 20, lpFile AS ASCIIZ * %MAX_PATH LOCAL SEI AS ShellExecuteInfo, Stat AS LONG, E AS LONG 'FUNCTION DoTheShellEx (BYVAL hwnd AS LONG, BYVAL ControlID AS LONG) AS LONG ' TEXT MESSAGES FROM Win32API 'GetLastError' callsįUNCTION SystemErrorMessageText (BYVAL ECode AS LONG) AS STRINGįormatMessage %FORMAT_MESSAGE_FROM_SYSTEM, BYVAL %NULL, ECode, %NULL, buffer, SIZEOF(buffer), BYVAL %NULLįUNCTION = FORMAT$(ECode, "#") & Buffer I got it posted and I also attached the #INCLUDE file here:ĭECLARE FUNCTION SystemErrorMessageText (BYVAL ECode AS LONG) AS STRING It uses the WinAPI function "FormatMessage() and it has been updated for A) Wide-char sensitivity and B) the extended internet errors I'll play with posting it later. Command line pdf merge code#heck I am having trouble with the code tags and file won't indent. heck let's post it in Source Code Forum with a meaningful title. let's see if I can find it (it's not in the source code section). You need to check your WinAPI doc for the ShellExecute Function and see what it returns and what that return might mean.įWIW, I just posted a real nice function for getting the text from a Windows-generated error code (as you work thru the doc you will find you need it). ? "lRes& = " lRes&ShellExecute does not return a process handle suitable for use in the WaitForSingleObject function. Code: lRes& = ShellExecute(0, "", z_exe, "*.pdf all.pdf", "", %SW_SHOWNORMAL) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |