Results 1 to 20 of 20

Thread: [RESOLVED] My program is not compatible with Windows XP

  1. #1

    Thread Starter
    Lively Member despotovski01's Avatar
    Join Date
    Apr 2011
    Posts
    100

    Resolved [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?

  2. #2
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    629

    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.

  3. #3

    Thread Starter
    Lively Member despotovski01's Avatar
    Join Date
    Apr 2011
    Posts
    100

    Re: My program is not compatible with Windows XP

    Quote Originally Posted by bergerkiller View Post
    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.

  4. #4
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    629

    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)

  5. #5
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,781

    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).

  6. #6

    Thread Starter
    Lively Member despotovski01's Avatar
    Join Date
    Apr 2011
    Posts
    100

    Re: My program is not compatible with Windows XP

    Quote Originally Posted by Grimfort View Post
    "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.

  7. #7
    PowerPoster cicatrix's Avatar
    Join Date
    Dec 2009
    Location
    Moscow, Russia
    Posts
    3,654

    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.

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    33,059

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9

    Thread Starter
    Lively Member despotovski01's Avatar
    Join Date
    Apr 2011
    Posts
    100

    Re: My program is not compatible with Windows XP

    Quote Originally Posted by techgnome View Post
    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.

  10. #10

    Thread Starter
    Lively Member despotovski01's Avatar
    Join Date
    Apr 2011
    Posts
    100

    Re: My program is not compatible with Windows XP

    Quote Originally Posted by cicatrix View Post
    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.

  11. #11
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,292

    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 -

  12. #12

    Thread Starter
    Lively Member despotovski01's Avatar
    Join Date
    Apr 2011
    Posts
    100

    Re: My program is not compatible with Windows XP

    Quote Originally Posted by stanav View Post
    Does the program crash as soon as it is opened under XP?
    No, first the splash screen is shown, and then the program crashes.

  13. #13
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,292

    Re: My program is not compatible with Windows XP

    Quote Originally Posted by despotovski01 View Post
    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 -

  14. #14
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    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

  15. #15

    Thread Starter
    Lively Member despotovski01's Avatar
    Join Date
    Apr 2011
    Posts
    100

    Re: My program is not compatible with Windows XP

    Quote Originally Posted by EntityX View Post
    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.

  16. #16

    Thread Starter
    Lively Member despotovski01's Avatar
    Join Date
    Apr 2011
    Posts
    100

    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?

  17. #17
    Fanatic Member
    Join Date
    Jul 2009
    Posts
    629

    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.

  18. #18

    Thread Starter
    Lively Member despotovski01's Avatar
    Join Date
    Apr 2011
    Posts
    100

    Re: My program is not compatible with Windows XP

    Quote Originally Posted by bergerkiller View Post
    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.

  19. #19
    New Member
    Join Date
    Nov 2014
    Posts
    1

    Thumbs up Re: My program is not compatible with Windows XP

    Quote Originally Posted by despotovski01 View Post
    Thanks you! I just found out that my program was crashing because of the icon.
    Many thanks for your superb suggestions. The error trapping function really helped. I had problem with folder location in windows that i was calling on my development PC which was not found on the other PC. I have used the Environment.GetFolderPath method to tackle that and have moved all my data files in the application Local

    Once again many thanks.

  20. #20
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,347

    Re: My program is not compatible with Windows XP

    Quote Originally Posted by EntityX View Post
    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
  •  



Click Here to Expand Forum to Full Width