Print Page | Close Window

[Solved] Markup Events Crash on Form Unload Me

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=15940
Printed Date: 05 October 2024 at 12:32am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [Solved] Markup Events Crash on Form Unload Me
Posted By: jpbro
Subject: [Solved] Markup Events Crash on Form Unload Me
Date 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




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