Print Page | Close Window

FlatEdit Validate Event Crashes VB6

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=10763
Printed Date: 30 April 2024 at 9:41am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: FlatEdit Validate Event Crashes VB6
Posted By: jpbro
Subject: FlatEdit Validate Event Crashes VB6
Date Posted: 23 May 2008 at 10:26pm
Try this:

1) Start a new Standard EXE project and add a UserControl
2) Draw a FlatEdit control on the UserControl (FlatEdit1)
3) Add this code to the UserControl:


Option Explicit

Public Event Validate(ByRef Cancel As Boolean)

Private Sub FlatEdit1_Validate(Cancel As Boolean)
    RaiseEvent Validate(Cancel)
End Sub


4) Draw 2 instances of the newly created UserControl1 on the form and run the project.
5) Press TAB a couple of times. If VB6 doesn't crash, close the form and go back to the UserControl designer.
6) Change the Appearance property to xtpAppearanceOffice2007 then re-run the project and Press TAB and it should crash the IDE.

This is in VB6 on Vista SP1.


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6




Replies:
Posted By: jpbro
Date Posted: 26 May 2008 at 11:41pm
Can anyone else confirm this problem? It even crashes the compiled app.

Here's source for testing:
uploads/20080526_234021_FlatEditBug.zip - uploads/20080526_234021_FlatEditBug.zip

Here's what appears in the more information box after the crash:

Problem signature:
  Problem Event Name:    APPCRASH
  Application Name:    FlatEditBug.exe
  Application Version:    1.0.0.0
  Application Timestamp:    483b821f
  Fault Module Name:    StackHash_c40b
  Fault Module Version:    0.0.0.0
  Fault Module Timestamp:    00000000
  Exception Code:    c000001d
  Exception Offset:    00010009
  OS Version:    6.0.6001.2.1.0.768.3
  Locale ID:    4105
  Additional Information 1:    c40b
  Additional Information 2:    fee4477d44b62ec10e7d5da40377474b
  Additional Information 3:    8269
  Additional Information 4:    2a9fe7a464e1ef156c04e26d31de7b11



-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Aaron
Date Posted: 27 May 2008 at 1:03am
Hi,
 
When compiled > crash
in IDE > seems OK
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Oleg
Date Posted: 27 May 2008 at 7:36am

Hi,

I see same with VB's TextBox.
 
Seems problem with reserved "Validate" event. just replace it to "Validate2"...


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Oleg
Date Posted: 27 May 2008 at 7:37am
...

Public Event Validate2(ByRef Cancel As Boolean)

Private Sub FlatEdit1_Validate(Cancel As Boolean)
    RaiseEvent Validate2(Cancel)
End Sub


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jpbro
Date Posted: 27 May 2008 at 9:40am
Thanks Oleg, that works fine.

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 27 May 2008 at 9:42am
Aaron, It doesn't always crash the IDE, but try changing the Appearance property to Office2007 and it usually does...In any case, Oleg's solution will satisfy my needs, but thanks for looking at it!

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Aaron
Date Posted: 28 May 2008 at 12:35am
Originally posted by jpbro jpbro wrote:

Aaron, It doesn't always crash the IDE, but try changing the Appearance property to Office2007 and it usually does...In any case, Oleg's solution will satisfy my needs, but thanks for looking at it!
 
Hi Jason,
 
How long do I need to press the TAB key? I did set Appearance property to Office2007 and it didn't crash, really! When compiled it crashes every time when the focus flatedit2 > flatedit1


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: jpbro
Date Posted: 28 May 2008 at 11:26am
Hey Aaron,

I've tested it again today, and it doesn't seem to be crashing the IDE anymore (at least not in the small sample project I gave you). In my larger project (that I cannot provide) it does crash the IDE still (really!), so I think that there must be some other interaction that is causing the bug. In any case, I don't really mind using Oleg's solution... The only thing I would be curious about is if there are any other side-effects of the bug that we haven't found yet.



-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Oleg
Date Posted: 28 May 2008 at 1:51pm
hey. There is no bug in our control. As I wrote I can see same if remove all our controls and add standard TextBox.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Aaron
Date Posted: 28 May 2008 at 2:05pm
Originally posted by oleg oleg wrote:

hey. There is no bug in our control. As I wrote I can see same if remove all our controls and add standard TextBox.
 
Hey, we didn't say it's a CJ bug.


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: jpbro
Date Posted: 28 May 2008 at 3:45pm
Ok, I think I understand why it happens. Putting your own Validate event in a UserControl isn't really necessary since it seems that the UserControl exposes its own Validate event (that is activated by the CausesValidation property) and having 2 events with the same name is undoubtedly a bad idea :)

I can just use the built-in Validate event for the same purpose as my custom Validate event

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net