Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [Solved] Markup Events Crash on Form Unload Me
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[Solved] Markup Events Crash on Form Unload Me

 Post Reply Post Reply
Author
Message
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Topic: [Solved] Markup Events Crash on Form Unload Me
    Posted: 30 December 2009 at 11:12pm
I had a support ticket open for a problem that I was having when using Markup events in the ReportControl. In my program, I wanted to unload the form hosting the reportcontrol when a markup image was clicked. Typically, this would be achieved simply by calling Unload Me. Unfortunately, this was crashing the IDE and generating an error report in the compiled EXE. Mark from Codejock suggested this workaround and it works well:


Private Const WM_CLOSE = &H10

Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Public Sub XamlMouseDown(Reserved1 As Object, Reserved2 As Object)
  ' Sample event raised from XAML in ReportControl

  PostMessage Me.hwnd, WM_CLOSE, vbNull, vbNull    ' Use this instead of Unload Me to prevent crash
End Sub


In case anyone else encounters the same problem, please use this workaround.

Happy New Year everyone!
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.107 seconds.