-
Jul 15th, 2011, 05:26 AM
#1
Thread Starter
Lively Member
[RESOLVED] My program is not compatible with Windows XP
Hey guys!
I've made a program in Visual Basic 2010 SP1, but users that are on Windows XP report that it isn't compatible, although they have installed Microsoft.NET Framework 4. I even tested it myself on a WinXP computer with the latest framework and it just crashes. My computer has Windows 7 and it works flawlessly. All my other programs are compatible with XP, but this one isn't. I have developed this program in Visual Basic 2010 SP1, and the other were developed in the normal Visual Basic 2010. Does this problem have anything to do with Visual Basic 2010 SP1?
-
Jul 15th, 2011, 05:53 AM
#2
Fanatic Member
Re: My program is not compatible with Windows XP
Do you use any special controls that are listed under "Visual Basic Powerpacks"?
I used one of these before (to draw a line) and it crashed my program as soon the dialog containing this control popped up.
-
Jul 15th, 2011, 05:55 AM
#3
Thread Starter
Lively Member
Re: My program is not compatible with Windows XP
Originally Posted by bergerkiller
Do you use any special controls that are listed under "Visual Basic Powerpacks"?
I used one of these before (to draw a line) and it crashed my program as soon the dialog containing this control popped up.
No, there's nothing special.
-
Jul 15th, 2011, 06:01 AM
#4
Fanatic Member
Re: My program is not compatible with Windows XP
Um could it be an API you use that should be declarated differently?
(Alias SendMessageA only fixes it for 32 bit, 64 bit can crash or fail)
(This also includes external libraries you referenced, they could be 32 bit only)
-
Jul 15th, 2011, 06:08 AM
#5
Re: My program is not compatible with Windows XP
"Just crashes" is not really enough to go on. Check the windows event log, usually you can get more info then that (if you did not get more and have just not told us of course).
-
Jul 15th, 2011, 07:32 AM
#6
Thread Starter
Lively Member
Re: My program is not compatible with Windows XP
Originally Posted by Grimfort
"Just crashes" is not really enough to go on. Check the windows event log, usually you can get more info then that (if you did not get more and have just not told us of course).
I got an error saying that the program had crashed and it asked me if I want to send an error report to Microsoft. That's all.
-
Jul 15th, 2011, 07:38 AM
#7
Re: My program is not compatible with Windows XP
Click Start/Run, enter eventvwr.msc and click OK.
You'll see a management console. Click the application branch on the left, on the right you'll see the list of errors. Look for your app there. Some extended information about the error can be there.
-
Jul 15th, 2011, 07:55 AM
#8
Re: My program is not compatible with Windows XP
Is the Win7 machine 64-bit by any chance? What is your build options set for? Any CPU? x64? x86?
-tg
-
Jul 15th, 2011, 02:08 PM
#9
Thread Starter
Lively Member
Re: My program is not compatible with Windows XP
Originally Posted by techgnome
Is the Win7 machine 64-bit by any chance? What is your build options set for? Any CPU? x64? x86?
-tg
It's built on Windows 7 64bit, but it's a 32bit program and it's tested and working on Windows 7 32bit. It has problems only with XP.
-
Jul 15th, 2011, 02:08 PM
#10
Thread Starter
Lively Member
Re: My program is not compatible with Windows XP
Originally Posted by cicatrix
Click Start/Run, enter eventvwr.msc and click OK.
You'll see a management console. Click the application branch on the left, on the right you'll see the list of errors. Look for your app there. Some extended information about the error can be there.
I did what you said. That didn't give me much info, just some binary.
-
Jul 15th, 2011, 03:04 PM
#11
Re: My program is not compatible with Windows XP
Does the program crash as soon as it is opened under XP?
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Jul 15th, 2011, 03:26 PM
#12
Thread Starter
Lively Member
Re: My program is not compatible with Windows XP
Originally Posted by stanav
Does the program crash as soon as it is opened under XP?
No, first the splash screen is shown, and then the program crashes.
-
Jul 15th, 2011, 03:33 PM
#13
Re: My program is not compatible with Windows XP
Originally Posted by despotovski01
No, first the splash screen is shown, and then the program crashes.
OK... So I guess there's something in your main splash screen or form load event that causes it to crash. You can try wrapping the splash screen/main form load code in a try/catch block (or handle the Application.UnhandledException event) to get some info on the error. We'll go from there once we'll get more info about the error.
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Jul 15th, 2011, 07:15 PM
#14
Fanatic Member
Re: My program is not compatible with Windows XP
When you use a Try Catch block always make sure to get the ex.Message.
Code:
Try
' Your form load event code or splash screen code or
' any other code you suspect might cause the problem.
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.
"Persistence is the magic of success." Paramahansa Yogananda
-
Jul 16th, 2011, 03:40 AM
#15
Thread Starter
Lively Member
Re: My program is not compatible with Windows XP
Originally Posted by EntityX
When you use a Try Catch block always make sure to get the ex.Message.
Code:
Try
' Your form load event code or splash screen code or
' any other code you suspect might cause the problem.
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
Yeah, I know. I'll do it now.
-
Jul 16th, 2011, 04:18 AM
#16
Thread Starter
Lively Member
Re: My program is not compatible with Windows XP
I've put an error handler. Here's the error:
"An error occurred creating the form. See Exception.InnerException for details. The error is: Exception has been thrown by the target of an invocation."
I suppose now I should create another messageBox with Exception.InnerException message, right?
-
Jul 16th, 2011, 05:09 AM
#17
Fanatic Member
Re: My program is not compatible with Windows XP
Functions:
Code:
Public Function GetExceptionText(ByVal Ex As Exception) As String
Dim trace As StackTrace = New StackTrace(Ex, True)
Dim msg As String = Ex.Message & vbCrLf
Try
For Each frame As StackFrame In trace.GetFrames
msg &= vbCrLf & "At " & frame.GetMethod.Name & " (" & frame.GetFileLineNumber & ")"
Dim name As String = System.IO.Path.GetFileName(frame.GetFileName)
If name <> "" Then msg &= " in " & name
Next
Catch
End Try
Return msg
End Function
Public Sub ShowExceptionDialog(ByVal Ex As Exception)
MessageBox.Show(GetExceptionText(Ex), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Sub
In the catch handler, simply add this:
Code:
ShowExceptionDialog(Ex)
It will show the entire stack trace, allowing you to see exactly at which line the error occurred.
-
Jul 16th, 2011, 05:18 AM
#18
Thread Starter
Lively Member
Re: My program is not compatible with Windows XP
Originally Posted by bergerkiller
Functions:
Code:
Public Function GetExceptionText(ByVal Ex As Exception) As String
Dim trace As StackTrace = New StackTrace(Ex, True)
Dim msg As String = Ex.Message & vbCrLf
Try
For Each frame As StackFrame In trace.GetFrames
msg &= vbCrLf & "At " & frame.GetMethod.Name & " (" & frame.GetFileLineNumber & ")"
Dim name As String = System.IO.Path.GetFileName(frame.GetFileName)
If name <> "" Then msg &= " in " & name
Next
Catch
End Try
Return msg
End Function
Public Sub ShowExceptionDialog(ByVal Ex As Exception)
MessageBox.Show(GetExceptionText(Ex), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Sub
In the catch handler, simply add this:
Code:
ShowExceptionDialog(Ex)
It will show the entire stack trace, allowing you to see exactly at which line the error occurred.
Thanks you! I just found out that my program was crashing because of the icon.
-
Nov 6th, 2014, 12:21 AM
#19
New Member
-
Nov 6th, 2014, 12:01 PM
#20
Re: My program is not compatible with Windows XP
Originally Posted by EntityX
When you use a Try Catch block always make sure to get the ex.Message.
Code:
Try
' Your form load event code or splash screen code or
' any other code you suspect might cause the problem.
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
IMHO error handling for the sake of error handling where you expect NO errors to occur is a bad idea... yes error handling is a necessity, but know when NOT to use it also...
I would suggest making a global unhandled error catcher and make it return something more useful than just the exception message (such as the call stack); also if you include the PDB files with your final project you can also get the line numbers for the call stack.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|