home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Avoiding_X20945512202007.psc / TestXpCrash / Crash / Form1.frm < prev    next >
Text File  |  2007-12-20  |  3KB  |  93 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   5010
  5.    ClientLeft      =   60
  6.    ClientTop       =   450
  7.    ClientWidth     =   8175
  8.    Icon            =   "Form1.frx":0000
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   5010
  11.    ScaleWidth      =   8175
  12.    StartUpPosition =   2  'CenterScreen
  13.    Begin CrashXP.UserControl1 UserControl11 
  14.       Height          =   495
  15.       Left            =   240
  16.       TabIndex        =   3
  17.       Top             =   1260
  18.       Width           =   2235
  19.       _ExtentX        =   3942
  20.       _ExtentY        =   873
  21.    End
  22.    Begin VB.CheckBox Check1 
  23.       Caption         =   "crash"
  24.       Height          =   495
  25.       Left            =   2640
  26.       TabIndex        =   1
  27.       Top             =   1260
  28.       Width           =   4215
  29.    End
  30.    Begin VB.CommandButton Command1 
  31.       Caption         =   "&About"
  32.       Height          =   435
  33.       Left            =   6840
  34.       TabIndex        =   0
  35.       Top             =   4440
  36.       Width           =   1215
  37.    End
  38.    Begin VB.Image Image1 
  39.       Height          =   2115
  40.       Left            =   180
  41.       Picture         =   "Form1.frx":000C
  42.       Top             =   2040
  43.       Width           =   7905
  44.    End
  45.    Begin VB.Label Label1 
  46.       BackColor       =   &H008080FF&
  47.       Caption         =   "Crash"
  48.       Height          =   1095
  49.       Left            =   60
  50.       TabIndex        =   2
  51.       Top             =   0
  52.       Width           =   8115
  53.    End
  54. End
  55. Attribute VB_Name = "Form1"
  56. Attribute VB_GlobalNameSpace = False
  57. Attribute VB_Creatable = False
  58. Attribute VB_PredeclaredId = True
  59. Attribute VB_Exposed = False
  60. '---------------------------------------------------------------------------------------
  61. ' Module    : Form1
  62. ' DateTime  : 12/20/2007
  63. ' Author    : Dracull
  64. ' Purpose   : Demonstration of XP theme crash in compiled exe
  65. '---------------------------------------------------------------------------------------
  66.  
  67. Option Explicit
  68.  
  69. Private Declare Sub InitCommonControls Lib "Comctl32" ()
  70.  
  71. Private Sub Command1_Click()
  72.   MsgBox "Example by DracullSoft"
  73. End Sub
  74.  
  75. Private Sub Form_Initialize()
  76.   '__ Must be done in Main() in a bas module or in the Form_Initialize()
  77.   InitCommonControls
  78. End Sub
  79.  
  80. Private Sub Form_Load()
  81.  Check1.Value = 1
  82.  Check1.Caption = "Usercontrol will cause crash!"
  83.  
  84.  Label1 = "Crash happens at offset 0x773e65e1 when closing an app using xp theme." & _
  85.   vbCrLf & "The Crash only happens in the Compiled exe when a usercontrol is on the form." & _
  86.   vbCrLf & "The method for enabling xp theme consists of a single call to 'InitCommonControls' in the Form_Initialize()." & _
  87.   vbCrLf & "Method 1 to avoid the Crash is to add a common dialogs control to the form. See CrashFree1." & _
  88.   vbCrLf & "Method 2 to avoid the Crash is to call 'InitCommonControls' from a Sub Main().  See CrashFree2."
  89.  
  90. End Sub
  91.  
  92.  
  93.