The error is very strange. It says "Windows cannot find 'xxxxx'. Make sure you typed the name correctly, and then try again." But where I have "xxxxx" here there are what appear to be Chinese characters; there are also Chinese characters in the title bar of the error. I have verified that the file really does exist.
Can anyone shed any light on this?
Here's the code:
Public Const SW_SHOW As Short = 5
Public Const SEE_MASK_INVOKEIDLIST As Short = 12
<DllImport("Shell32", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function ShellExecuteEx(ByRef lpExecInfo As SHELLEXECUTEINFO) As Boolean
End Function
Function Test
Dim sei As New SHELLEXECUTEINFO
sei.cbSize = Marshal.SizeOf(sei)
sei.lpVerb = "properties"
sei.lpFile = "c:\systeminfo.ini"
sei.nShow = SW_SHOW
sei.fMask = SEE_MASK_INVOKEIDLIST
If Not ShellExecuteEx(sei) Then
Dim ex As New System.ComponentModel.Win32Exception(System.Runtime.InteropServices.Marshal.GetLastWin32Error())
MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
end function
Submitted via EggHeadCafe - Software Developer Portal of Choice
Dundas Upload - Restrict Access - Complete Code
http://www.eggheadcafe.com/tutorials/aspnet/273af48b-e5f4-48f4-8f67-a488ec4d7285/dundas-upload--restrict.aspx
Here it works. I've used the declaration for SHELLEXECUTEINFO from
http://www.pinvoke.net/default.aspx/shell32.shellexecuteex
Any difference to your declaration?
--
Armin
"Armin Zingler" wrote:
> .
>