Click here to Skip to main content
16,018,249 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionXML -> VB.NET -> SQL Pin
Ziaous4-May-07 6:26
Ziaous4-May-07 6:26 
AnswerRe: XML -> VB.NET -> SQL Pin
Kevin Nicol4-May-07 6:49
Kevin Nicol4-May-07 6:49 
GeneralRe: XML -> VB.NET -> SQL Pin
Ziaous4-May-07 7:52
Ziaous4-May-07 7:52 
AnswerRe: XML -> VB.NET -> SQL Pin
andyharman4-May-07 7:48
professionalandyharman4-May-07 7:48 
GeneralRe: XML -> VB.NET -> SQL Pin
Ziaous4-May-07 9:08
Ziaous4-May-07 9:08 
QuestionAdd menu items to the context menu Pin
chakor1234-May-07 5:15
chakor1234-May-07 5:15 
AnswerRe: Add menu items to the context menu Pin
Dave Kreskowiak4-May-07 6:40
mveDave Kreskowiak4-May-07 6:40 
QuestionVista and a .NET application on a shared network Pin
EMSDeveloper4-May-07 4:20
EMSDeveloper4-May-07 4:20 
I have a .NET (2.0) application that is on a shared network. I have used caspol (Microsoft .NET Framework 2.0 Configuration) to grant FullTrust permission to the application. When I execute the application on Windows XP it works fine. If I run in on Vista I get the following error:



The description for Event ID 1000 from source Application Error cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

EMS.exe
34.0.131.0
463909e3
KERNEL32.dll
6.0.6000.16386
4549d328
e0434f4d
00000000000233ac

The substitution string for insert index (%1) could not be found


After stepping through the code and creating a test windows app I found that this line is causing problems:

AddHandler Application.ThreadException, AddressOf eh.OnThreadException


What is Vista doing differently and why would this line cause my application to fail?


Here's the full code for a simple windows app that will fail:

Imports System.Threading

Public Class Main
Public Shared Sub Main()
Application.EnableVisualStyles()

Dim eh As New CustomExceptionHandler
AddHandler Application.ThreadException, AddressOf eh.OnThreadException 'If you remove this line the app will run on Vista

Dim frm As New Form1

frm.ShowDialog()

End Sub

Private Class CustomExceptionHandler 'To Handle Application.ThreadExceptions
Public Sub OnThreadException(ByVal sender As Object, ByVal t As ThreadExceptionEventArgs)
ErrorHandler(t.Exception)
End Sub
End Class

Public Shared Sub ErrorHandler(ByVal ex As Exception)
'Error Handler code here
End Sub
End Class



Thanks,

Sean

AnswerRe: Vista and a .NET application on a shared network Pin
Dave Kreskowiak4-May-07 4:54
mveDave Kreskowiak4-May-07 4:54 
QuestionRe: Vista and a .NET application on a shared network Pin
EMSDeveloper4-May-07 5:46
EMSDeveloper4-May-07 5:46 
AnswerRe: Vista and a .NET application on a shared network Pin
Dave Kreskowiak4-May-07 6:34
mveDave Kreskowiak4-May-07 6:34 
QuestionSystems Collections Generic Pin
tonysmithbrewster4-May-07 3:31
tonysmithbrewster4-May-07 3:31 
AnswerRe: Systems Collections Generic Pin
Tarakeshwar Reddy4-May-07 4:03
professionalTarakeshwar Reddy4-May-07 4:03 
AnswerRe: Systems Collections Generic Pin
Dave Kreskowiak4-May-07 4:35
mveDave Kreskowiak4-May-07 4:35 
QuestionHow to Send and receive XML packets??? Pin
shahid_isb854-May-07 2:38
shahid_isb854-May-07 2:38 
AnswerRe: How to Send and receive XML packets??? Pin
Dave Kreskowiak4-May-07 4:30
mveDave Kreskowiak4-May-07 4:30 
QuestionHow to program an application to terminate automatically? Pin
virendra_0074-May-07 2:37
virendra_0074-May-07 2:37 
AnswerRe: How to program an application to terminate automatically? Pin
Arun.Immanuel4-May-07 2:49
Arun.Immanuel4-May-07 2:49 
AnswerRe: How to program an application to terminate automatically? Pin
Dave Kreskowiak4-May-07 4:24
mveDave Kreskowiak4-May-07 4:24 
Questionarray of bytes into an array of string Pin
Rohit Dev4-May-07 0:19
Rohit Dev4-May-07 0:19 
AnswerRe: array of bytes into an array of string Pin
Dave Kreskowiak4-May-07 4:17
mveDave Kreskowiak4-May-07 4:17 
QuestionConvertion of 2003 to 2005 errors Pin
Central_IT3-May-07 23:38
Central_IT3-May-07 23:38 
AnswerRe: Convertion of 2003 to 2005 errors Pin
Rupesh Kumar Swami4-May-07 0:08
Rupesh Kumar Swami4-May-07 0:08 
GeneralRe: Convertion of 2003 to 2005 errors Pin
Central_IT4-May-07 1:37
Central_IT4-May-07 1:37 
Questiondeploying the files Pin
taherjaorawala3-May-07 23:36
taherjaorawala3-May-07 23:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.