Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3499496
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:37:06+00:00 2026-05-18T12:37:06+00:00

I have a WinForms application in which I want to be able to provide

  • 0

I have a WinForms application in which I want to be able to provide an HTML editing feature. So I’ve translated Lutz Roeder’s HTML Writer from C# into VB.NET, and converted it from a windows form into a Custom User Control, which is now hosted in an MDI child form.

It all works fine until I close the parent MDI, in which case it crashes, and I cannot trap the exception.

I’ve isolated the editor control into a little vanilla WinForms app that doesn’t do anything else, and verified that the problem still occurs.

I’ve also switched on Unmanaged Code Debugging (I’m using VS2010, compiling for x86 and Framework 3.5), and all I get is this:

Windows has triggered a breakpoint in HtmlEditorMdi.exe.
This may be due to a corruption of the heap, which indicates a bug in HtmlEditorMdi.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while HtmlEditorMdi.exe has focus.
The output window may have more diagnostic information.

The only thing other thing I’ve noticed is that if I leave a long interval after opening the form containing the editor, it doesn’t crash.

What I’d really appreciate is some ideas about how to go looking for this problem. It may be of course that I’ve made a mistake in the C# to VB conversion, but I’m struggling to know where to look.

Edit:

I’ve run the app with the debugger attached, and it doesn’t give me anything useful.

All I get is the Windows ‘Application has stopped working’ message, with this in the problem details:

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: HtmlEditorMdi.exe
  Application Version:  1.0.0.0
  Application Timestamp:    4cfb74c7
  Fault Module Name:    mscorwks.dll
  Fault Module Version: 2.0.50727.4952
  Fault Module Timestamp:   4bebd49a
  Exception Code:   c0000005
  Exception Offset: 000022b5
  OS Version:   6.1.7600.2.0.0.256.1
  Locale ID:    2057
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

I can see that it’s an access violation, but even if I go Debug > Exceptions > Win32 Exceptions, and tick c0000005, I don’t get anything useful when it breaks – just ‘no source available’.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T12:37:07+00:00Added an answer on May 18, 2026 at 12:37 pm

    The first message you quoted is produced by the Windows heap manager when it discovers that the internal heap structure is destroyed. It displays that diagnostic when it sees that a debugger is attached. The 2nd quoted block is what happens when it bypasses the diagnostic (no debugger attached), it bombs on a hardware exception when it tries to release memory in the corrupted heap anyway.

    The trouble with heap corruption is that the real damage is done a long time before the diagnostic is generated. You can see a stack trace leading up to the diagnostic in the Call Stack window, you’ll need to enable the Microsoft symbol server to get meaningful symbols for the Windows functions. But it won’t tell you anything useful about the code that really caused the damage, that requires a time machine.

    This kind of heap corruption is invariably caused by unmanaged code. The AccessViolation exception is a well known scourge to C/C++ programmers and a very large reason why managed code became popular. While Lutz’ source code is all managed, it contains a lot of P/Invoke and COM interface declarations. There is no good way to debug them, you don’t have the source code.

    Getting one of those declarations subtly wrong when you converted them to VB.NET is certainly one way this could happen. It could also well be that the bug was always there but reared its ugly head just now. Lucky you. Btw, I don’t think the code is 64-bit clean, force it to run in 32-mode for a possible quick fix. For your main EXE project: Project + Properties, Compile tab, scroll down, Advanced Compile Options, Target CPU = x86. This is only relevant if you run on a 64-bit version of Windows.

    Other than that, I’d recommend you just use the C# project as-is. Mixing languages in a solution is a very well supported scenario in .NET.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a WinForms application which runs on a touch-screen on a bit of
I have a winforms application in which I am using 2 Forms to display
I have C# winforms application that needs to start an external exe from time
I have a C# 3.0 WinForms application which is occasionally required to control Excel
Ok, I have developed this WinForms client, which interacts with a server (ASPX Application)
I have created a SQL DB-based winforms application, and I want to deploy it
I have a setup project whose primary output is from a Winforms based application.
I have a C# .net winforms application with two forms which connects to sql
I am developing a winforms application and I have a scenario where I want
I have a WinForms application with a DataGridView control and a column of DataGridViewButtonCell

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.