Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ShellExecute
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
01446508
Message ID:
01446533
Views:
117
No errors, seems to be working on my system but very flaky on the other one, most times the body of the email will be blank.
But just now on mine, I am getting:
"The command line argument is not valid. Verify the switch you are using." This seems to happen when I have outlook open, but not when it is closed.



>>Hi, I had a ShellExecute cmd working under XP to instantiate the default windows email program whcih was outlook express. But in Vista it doesn't seem to be working. Can you advise?
>>
>>#DEFINE SW_SHOWNORMAL 1
>>#DEFINE SW_SHOWMINIMIZED 2
>>#DEFINE SW_SHOWMAXIMIZED 3
>>
>>t1="mailto:someguy@hotmail.com?Subject=" +title+"&Body="+CHRTRAN( contents, [&], [+] )
>>
>>lcFileName=t1
>>DECLARE INTEGER ShellExecute IN shell32 ;
>> INTEGER lnhwnd, STRING lcOperation, ;
>> STRING lcFile, STRING lcParameters, ;
>> STRING lcDirectory, INTEGER lnShowCmd
>>lnRes = ShellExecute( 0, "open", lcFileName, "", "", SW_SHOWMAXIMIZED )
>
>What is the value of lnRes?
>
>
>What that gives to you?
>
>
>lnRes = ShellExecute( 0, "open", lcFileName, "", "", SW_SHOWMAXIMIZED )
>
>fl_error = (lnRes >= 0  AND lnRes < 32)
>DO CASE
>      CASE lnRes < 0  OR lnRes > 32
>                **** Everything is OK
>      CASE lnRes = 0 
>           txt = "The operating system is out of memory or resources.".
>      CASE lnRes = 2
>           txt = "The specified file was not found".
>      CASE lnRes = 3
>           txt = "The specified path was not found.".
>      CASE lnRes = 5
>           txt = "Windows 95 only: The operating system denied access to the specified file".
>      CASE lnRes = 8 
>           txt = "Windows 95 only: There was not enough memory to complete the operation.".
>      CASE lnRes = 10
>           txt = "Wrong Windows version".
>      CASE lnRes = 11
>           txt = "The .EXE file is invalid (non-Win32 .EXE or error in .EXE image).".
>      CASE lnRes = 12
>           txt = "Application was designed for a different operating system".
>      CASE lnRes = 13
>           txt = "Application was designed for MS-DOS 4.0".
>      CASE lnRes = 15
>           txt = "Attempt to load a real-mode program".
>      CASE lnRes = 16
>           txt = "Attempt to load a second instance of  an application with non-readonly data segments".
>      CASE lnRes = 19
>           txt = "Attempt to load a compressed application file".
>      CASE lnRes = 20
>           txt = "Dynamic-link library (DLL) file failure".
>      CASE lnRes = 26
>           txt = "A sharing violation occurred.".
>      CASE lnRes = 27
>           txt = "The filename association is incomplete or invalid.".
>      CASE lnRes = 28
>           txt = "The DDE transaction could not be completed because the request timed out.".
>      CASE lnRes = 29
>           txt = "The DDE transaction failed.".
>      CASE lnRes = 30
>           txt = "The DDE transaction could not be completed because other DDE transactions were being processed.".
>      CASE lnRes = 31
>           txt = "There is no application associated with the given filename extension.".
>      CASE lnRes = 32
>           txt = "Windows 95 only: The specified dynamic-link library was not found.".
>  OTHERWISE
>           txt = "undocumented".
>ENDCASE
>IF fl_error
>   MessageBox(txt)
>ENDIF
>
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Previous
Reply
Map
View

Click here to load this message in the networking platform