Results 1 to 8 of 8

Thread: User-defined event crashes TwinBasic

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2015
    Posts
    323

    User-defined event crashes TwinBasic

    Hi TwinBasic team. You are appreciated!

    I found an issue with TB. Perhaps already known. The following code causes TB to keep "Restarting From Memory" when trying to run in the IDE.

    Binary build completes successfully but fails silently and will not run.


    Code:
     Private Sub UpdateColorInfo()
            
            Dim nH As Single, nS As Single, nL As Single
            txtInfo(0).Text = "&H" + Hex(lblCurColor.BackColor)
            txtInfo(1).Text = Color2Long(Trim(txtInfo(2).Text))
            txtInfo(2).Text = ColorToHTML(lblCurColor.BackColor)
          
            RaiseEvent ColorChanged '<-- This crashes TwinBasic.
        End Sub
    If I rem out that event call, then all is well. And there is nothing special about the event declaration. Further, the event is not being used outside anywhere

    I've also noticed that TB does not always fire certain valid events, including some which are baked into VB6 intrinsic controls.

    Anyway, hope this is helpful. Keep up the good work .

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2015
    Posts
    323

    Re: User-defined event crashes TwinBasic

    Unfortunately I can't use TwinBasic for my project until this is resolved.

  3. #3
    Hyperactive Member
    Join Date
    Dec 2020
    Posts
    318

    Re: User-defined event crashes TwinBasic

    Hi, thanks for your report. However, we'll need you to provide a sample to demonstrate the issue as we cannot see any general problem in this regard, so something else is likely influencing it.

  4. #4
    PowerPoster wqweto's Avatar
    Join Date
    May 2011
    Location
    Sofia, Bulgaria
    Posts
    6,183

    Re: User-defined event crashes TwinBasic

    @SomeYguy: Create a small Std-EXE project in TB and copy/paste offending code in Form1 which crashes the IDE and post the project here. There is no other way this can be fixed without a small reproducable project which Wayne can open in debugger and sort it out.

    My guess is it will be *extremely* difficult for you to create such small repro project as the root cause of the problem you have is in some other part of your large project which if you were able to figure out then no bug-report would need to be filed. Note that Wayne is not offering to debug your large project though he's done this multiple times in the past to figure out obscure bug-reports.

    cheers,
    </wqw>

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2015
    Posts
    323

    Re: User-defined event crashes TwinBasic

    Quote Originally Posted by WaynePhillipsEA View Post
    Hi, thanks for your report. However, we'll need you to provide a sample to demonstrate the issue as we cannot see any general problem in this regard, so something else is likely influencing it.

    Hi Wayne, thanks for reply. No sample necessary as I can guarantee that nothing is influencing that event declaration nor the call. The event is simply declared at the top of the module i.e. Public Event ColorChanged(), and thats it.

    Further, it is not being used externally in any way. There is physically no code written to use the event. It is raised in the UpdateColorInfo procedure as shown above but that is all.

    EDIT: I should also mention that it does run in vb6.
    Last edited by SomeYguy; Today at 01:06 PM.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2015
    Posts
    323

    Re: User-defined event crashes TwinBasic

    Dupe, Oops

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2015
    Posts
    323

    Re: User-defined event crashes TwinBasic

    Quote Originally Posted by wqweto View Post
    @SomeYguy: Create a small Std-EXE project in TB and copy/paste offending code in Form1 which crashes the IDE and post the project here. There is no other way this can be fixed without a small reproducable project which Wayne can open in debugger and sort it out.

    My guess is it will be *extremely* difficult for you to create such small repro project as the root cause of the problem you have is in some other part of your large project which if you were able to figure out then no bug-report would need to be filed. Note that Wayne is not offering to debug your large project though he's done this multiple times in the past to figure out obscure bug-reports.

    cheers,
    </wqw>
    Thank you . But as noted, no sample should be needed because there is no code beyond the declaration ( Public Event ColorChanged() ) and the raise call. No code physically written in the event.

  8. #8
    Hyperactive Member
    Join Date
    Dec 2020
    Posts
    318

    Re: User-defined event crashes TwinBasic

    I just tried your code on a form.. no crash. On a user control... no crash. In a class... no crash. I also tried it all on both 32-bit and 64-bit... no crash.

    There's good reason behind us asking for a simple example project, and that is because other factors can influence the problem that perhaps you are not aware of. Sometimes the act of creating a minimal example helps you to further narrow down the problem before we even get to look at it, and this ultimately makes it more likely we'll get to fix the problem sooner.

    It would be much appreciated if you could please give us a simple example project to demonstrate the issue.

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