-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Application crash when using .ocx with events that have ref objects, works in Framework - System.Windows.Forms.AxHost #2863
Comments
This is pretty nasty bug.. hope winforms developers aren’t using any ActiveX controls... |
They'll have to work around this (or not use .NET Core) until its fixed eventually, like they have to work around the other bugs in the Desktop version. I have seen a few crashing/corruption bugs with Desktop Framework AxHost which never were fixed. OLE/ActiveX is a dying technology which few still understand, lots of documentation already disappeared, and there is almost no test coverage in the WinForms repo, so its not surprising things start to break. The best bet if you want to keep AxHost technology working is if C++/MFC control authors step up (because that technology seems to be still officially supported) and bring testable scenarios so WinForms can actually support them in a reliable way. That aside, VB6 has been unsupported for ages and (as far as I'm aware) is subject for failing at any time. In particular it relies on the same interop as the Office API (IMsoComponentManager) and even for Office its currently unclear on whether .NET Core will support interop integration. If they don't reimplement IMsoComponentManager support you'll have to get ready for a rough trip ahead if you still use VB6 components because all the hidden magic WinForms Desktop Framework did behind the scenes to coordinate modal forms and things like I'm not trying to talk bad, just trying to be realistic on the perspective given what I currently know about the ecosystem. We have an application ourselves which originated in VB6 and still isn't 100% ported over to C#, but as it looks currently I'd never dare to move that application to .NET Core. Also, just as a fair warning, if you expose .NET to VB6 you better not try to register any .NET Core component in the registry without knowing exactly what you are doing. The COM story for WinForms has not been thought through at all and the |
Just put this up because the code works in framework and it has broken in core with no work around I could find in core.. I don’t need it fixed for myself, just noticed it so thought I’d report it as it’s bound to be an easy fix as it is 100% reproducible.. |
I didn't intend to imply you should close the issue, note that I'm not a team member and just trying to be helpful, in this case explaining the larger picture of why things are in a bad state and giving a warning that VB6 will cause trouble on .NET Core regardless of AxHost bugs getting fixed. Feel free to reopen if you care about this bug getting looked at or want an official response about how they deal with VB6 repros in WinForms, as far as I remember there has not been a precedent on github (Microsoft sometimes did reject repros based on VB6 in our own support tickets in the past, so we often had to make sure bugs also affect C++/MFC). /cc @RussKie in case you want this to be looked at even though the issue is closed |
3.1 LTS broken but fixed in 5.0 so all Good :-D |
@NikolaosWakem if this is fixed, can the issue be closed? |
This submission has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 14 days. It will be closed if no further activity occurs within 7 days of this comment. |
.NET Core Version:
3.0 & 3.1
Have you experienced this same bug with .NET Framework?:
No
Problem description:
Using ActiveX .ocx user control that has specifically not null, ref objects passed on events crashes entire application due to corrupt memory - Same code works in Framework
Expected behavior:
ref object is not corrupt on return to OCX after calling event inside core application
Minimal repro:
example winforms control that works in framework and core
example OCX (in VB6) control that works in framework by crashes in core
// CTestObject.cls
Here is a repro in a zip
https://axolotl.blob.core.windows.net/issue2863/Issue2863.zip
you have to first register the .ocx "regsvr32 Issue2863\VB6OCX\Axolotl.TestControl.ocx"
then run ConsoleApp1 (core) in debug with exceptions turned on.. (ConsoleApp2 is framework and works)
Issue2863\VB6OCX\Axolotl.TestControl.ctl
MsgBox a.Text <== a is corrupt
Exception thrown at 0x11001F16 (Axolotl.TestControl.ocx) in ConsoleApp1.exe: 0xC0000005: Access violation reading location 0x00000000. occurred
The text was updated successfully, but these errors were encountered: