Running an application executable (release) runs find on my computer:
"The application attempted to perform an operation not allowed by the
security policy."...
System.Security.SecurityException:
System.Security.Permissions.SecurityPermission...
Thoughts?
I was able to narrow the problem down the EnumWindows API call and
AddressOf Callback routine here:
Public Sub InitList()
Dim cb As CallBack
cb = New CallBack(AddressOf MyCallBack)
EnumWindows(cb, 0)
End Sub
Public Function MyCallBack(ByVal hwnd As IntPtr, ByVal lParam As
IntPtr) As Boolean
Dim intLen As Integer = GetWindowTextLength(hwnd) + 1
If intLen > 1 Then
Dim strText As New StringBuilder(intLen)
Try
GetWindowText(hwnd, strText, intLen)
If IsWindowEnabled(hwnd) And IsWindowVisible(hwnd) Then
lvWindows.Items.Add(strText.ToString).SubItems.Add(hwnd.ToString)
End If
Catch ex As Exception
Trace.WriteLine(ex.ToString)
End Try
End If
Return True
End Function
Public Delegate Function CallBack(ByVal hwnd As IntPtr, ByVal lParam
As IntPtr) As Boolean
Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As
CallBack, ByVal lParam As Integer) As Integer
Brian - 08 Apr 2007 17:57 GMT
If you tried to execute it from a nework share/drive and that is what did
not work, try going to control panel->admin tools->.net framework config
1.1/2.0 etc.
Then adjust zone security. Adjust all the zones to allow everything and then
start backing them off again. This has worked for most everything I have
deployed although I was looking for answers myself because it doesn't work
on everything.
brian
> Running an application executable (release) runs find on my computer:
>
[quoted text clipped - 41 lines]
> Public Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As
> CallBack, ByVal lParam As Integer) As Integer
Zamdrist - 09 Apr 2007 15:19 GMT
> If you tried to execute it from a nework share/drive and that is what did
> not work, try going to control panel->admin tools->.net framework config
[quoted text clipped - 5 lines]
>
> brian
Thanks Brian.
What an absolute pain in the a.s programming has become. <sigh>