Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ShellExecute to a C# exe fails - Access is denied
Message
 
 
To
12/10/2006 17:43:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01161572
Message ID:
01161600
Views:
28
This message has been marked as the solution to the initial question of the thread.
>>>>>>After compiling mytest.cs without an error, I run mytest.exe but nothing happens. Am supposed to see a window with a message? What am I doing wrong?
>>>>>
>>>>>No it's working there from command window:) Check temp folder. It should have created test.txt with "Hello from C#" in it.
>>>>>Problem it fails if called from VFP via ShellExecute().
>>>>>Cetin
>>>>
>>>>yes, you are correct. the file test.txt has been successfully created. Now, after I figure out how to run this .exe in ShellExecute in VFP, I will let you know what happens here.
>>>
>>>OK. Here is test code (assuming exe is c:\temp\test.exe):
>>>
>>>
>>>DECLARE INTEGER ShellExecute IN shell32.dll ;
>>> INTEGER hwnd, ;
>>> STRING operation, ;
>>> STRING file, ;
>>> STRING params, ;
>>> STRING workdir, ;
>>> INTEGER showcmd
>>>
>>>? ShellExecute(0,"Open","c:\temp\test.exe",0,0,1)
>>>
Hope you get something over 32 as return value.
>>>Cetin
>>
>>I just sent you a message. And my code looks almost exactly as yours. And it works on my PC.
>>
>>Could it be that your PC is tired? <g> (given the late hour of your time)
>
>Might be but it's not on this PC. On this one I don't have 2.0 yet and no VFP.
>Cetin

The return value I get from SH is 42, now I know what you mean by 32.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform