jjkix
(Fresh Scripter)
2017-04-18 03:22 PM
Fatal exception occurred

Error in using the DoEvents method in KixForms

Precondition for reproduction:
Windows 10 Version 1703 (Build 15063.138) (creators update)
KixTart Version 4.61 (or another version)
KixForms Version 2.46.55.0 (or another version)

 Code:
Break On
$System = CreateObject("Kixtart.System")
$Form = $System.Form()
$Form.Show
While $Form.Visible
  $ = Execute($System.Application.DoEvents)
  ; or alternative code
  ;$ = Execute($Form.DoEvents)
Loop
Exit 1


Run with wkix32.exe:
Error:
---------------------------
>>> KiXtart <<<
---------------------------
Fatal exception occurred.
---------------------------
OK
---------------------------

Can you please tell me if this error is known or better if it is fixed?
If it is fixed, on which date the bugfix will be released?

Thank you!
Best regards


AllenAdministrator
(KiX Supporter)
2017-04-18 03:57 PM
Re: Fatal exception occurred

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=210525#Post210525

jjkix
(Fresh Scripter)
2017-04-18 05:31 PM
Re: Fatal exception occurred

Hello Allen,
before I posted the article, I've already tested all versions of KixForms and KixTart, even KixForms 4.67.
The error has not occurred with the Windows 10 version 1607. But with the Windows 10 version 1703, the error can be reproduced.


AllenAdministrator
(KiX Supporter)
2017-04-18 10:56 PM
Re: Fatal exception occurred

I'm not getting the same error as you, but it's not working on Win 10 1703 and Kixforms 247. Installer appears to work, but the error I'm getting with kixomatic is

"Kixforms.net not initiated. This Script will now close."


Arend_
(MM club member)
2017-04-19 09:02 AM
Re: Fatal exception occurred

 Originally Posted By: Allen
I'm not getting the same error as you, but it's not working on Win 10 1703 and Kixforms 247. Installer appears to work, but the error I'm getting with kixomatic is

"Kixforms.net not initiated. This Script will now close."


You do realise that kixforms 2.47 and kixforms.net are two different things right?


jjkix
(Fresh Scripter)
2017-04-19 09:34 AM
Re: Fatal exception occurred

I am using KixForms-Classic. I get the error on several machines.
KixForms.net funktioniert, braucht jedoch .Net Framework 3.5. Ich kann die Scripte aber nicht auf KixForms.net umstellen. Es wäre zu viel.
Hoffentlich hat jemand eine Lösung oder kann die KixForms-Classic Bibliothek anpassen.
Thank you!
Best regards


jjkix
(Fresh Scripter)
2017-04-19 09:37 AM
Re: Fatal exception occurred

Sorry... Now in English.
I am using KixForms-Classic. I get the error on several machines.
KixForms.net works but needs .Net Framework 3.5. I can not change the scripts but on KixForms.net. It would be too much.
Hopefully someone has a solution or can customize the KixForms Classic library.


Arend_
(MM club member)
2017-04-19 10:08 AM
Re: Fatal exception occurred

Yeah, I've updated now as well to the creators update and my Kixforms.net scripts work fine.
The Classic KixForms scripts are unreliable, some work and some crash.
Unfortunately it isn't updated anymore 2.47 was the last version and the author isn't around much :-/

 Code:
The description for Event ID 5 from source KIXTART cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

Fatal exception occurred.
 Error : (0xc0000005/-1073741819)


The GUI does appear sometimes, so it's hard to figure out when it exactly crashes.
I'll have to build a kixforms script from scratch to see where it crashes.


jjkix
(Fresh Scripter)
2017-04-19 11:09 AM
Re: Fatal exception occurred

It is the DoEvents method
 Code:
...
While $Form.Visible
  $ = Execute($System.Application.DoEvents)
Loop
...


jjkix
(Fresh Scripter)
2017-04-19 11:12 AM
Re: Fatal exception occurred

I get the same message as Arend in the EventViewer

Arend_
(MM club member)
2017-04-19 11:32 AM
Re: Fatal exception occurred

It seems like it only happens with kix 4.64 and higher.
4.61 and lower works fine.


Nope, this only helped for some forms, the old kixomatic fails on each version.
But KixTris works on every version.


Arend_
(MM club member)
2017-04-19 01:04 PM
Re: Fatal exception occurred

I've made a simple script that helped me pinpoint where the problem is located.
Maybe Lonkero can make more sense of it.
Basically the "$=Execute($Form.DoEvents())" causes the Fatal Exception, if you uncomment that line where thing works as it should but off course the loop keeps going and none of the events are triggered.
 Code:
Break On
$=SetOption('Explicit','On')
Dim $System, $Form, $Label1
Global $ComboBox1
$System = CreateObject("Kixtart.System")

$Form = $System.Form()
$Form.BackColor = 212,208,200
$Form.FontSize = 8,25
$Form.Height = 158
$Form.Left = 785
$Form.Text = "Test Dialog"
$Form.Top = 0
$Form.Width = 240

$Label1 = $Form.Controls.Label()
$Label1.BackColor = 212,208,200
$Label1.FontSize = 8,25
$Label1.Height = 16
$Label1.Left = 15
$Label1.Text = "User:"
$Label1.Top = 15
$Label1.Width = 59

$ComboBox1 = $Form.Controls.ComboBox()
$ComboBox1.DropDownWidth = 121
$ComboBox1.FontSize = 8,25
$ComboBox1.Height = 21
$ComboBox1.Left = 75
$ComboBox1.Sorted = "False"
$ComboBox1.Text = ""
$ComboBox1.Top = 15
$ComboBox1.Width = 121

$Form.Show
Init()
While $Form.Visible
  $=Execute($Form.DoEvents())
? @SERROR
Loop
Exit @ERROR

Function Init()
  Dim $Users, $User, $arrFilter[0]
  $arrFilter[0] = "User"
  $Users = GetObject("WinNT://@ldomain")
  $Users.filter = $arrFilter
  For Each $User In $Users
    $ComboBox1.AddItem ($User.Name)
  Next
EndFunction


Arend_
(MM club member)
2017-04-19 01:12 PM
Re: Fatal exception occurred

Even this piece of code causes the error:
 Code:
$System = CreateObject("KiXtart.System")
$Form = $System.Form()
$Form.Show()
While $Form.Visible
   $Nul = Execute($Form.DoEvents)
Loop
Exit 0


Arend_
(MM club member)
2017-04-19 01:26 PM
Re: Fatal exception occurred

Apparently this happened before on Windows 7.
The author (Shawn) recompiled this using Visual Studio 2008 which solved the problem back then. I suppose it has to be compiled with VS2013 or higher this time.
But Shawn doesn't stop by much anymore.

Just to be clear, I tried the above using the following Kix versions:
4.51, 4.52, 4.53, 4.60, 4.61, 4.64, 4.66, 4.67
And KixForms versions 2.47.5 (latest known version).


AllenAdministrator
(KiX Supporter)
2017-04-19 02:37 PM
Re: Fatal exception occurred

I've never installed any version other than kixforms classic. I realized that the message said it wanted .net, but I never used that, so it was just as confusing to me as to why it wanted it.

anglerzac
(Just in Town)
2017-04-19 03:59 PM
Re: Fatal exception occurred

This issue is affecting us as well, since Windows 10 Creators Update. We have tried all combinations of Kix 460/461/462/463/464/466/467 and kixforms 2.47.4.0 / 2.47.5.0 / 2.46.55.0

This simple code generates the fault
 Quote:
Break On

$System = CreateObject("Kixtart.System")

$Form = $System.Form()

$Form.Caption = "This is my first KiXforms script"
$Form.Width = 300
$Form.Height = 600
$Form.Center

$Form.Show

While $Form.Visible
$ = Execute($System.Application.DoEvents)
Loop

Exit 1

We are looking at translating our code to vb or c# .net but I wonder if anyone can see a fix coming from an updated version of KIX or will this require an update to kixforms?


Arend_
(MM club member)
2017-04-19 04:49 PM
Re: Fatal exception occurred

 Originally Posted By: anglerzac

We are looking at translating our code to vb or c# .net but I wonder if anyone can see a fix coming from an updated version of KIX or will this require an update to kixforms?

Basically if you continue with the Creators Update of Windows 10 you will have to rewrite your KiXforms scripts into KiXforms.Net.
Unless Shawn pops by and fixes it, but that's highly unlikely.


AllenAdministrator
(KiX Supporter)
2017-04-19 10:14 PM
Re: Fatal exception occurred

Don't give up just yet... Another possibility of a fix could happen.

Arend_
(MM club member)
2017-04-20 08:59 AM
Re: Fatal exception occurred

Interestingly the kixtart.system object always crashes at Form.DoEvents.
But the kixtart.form object doesn't always.
My simple test code works fine, as does KixTris which uses kixtart.Form.
But KixOmatic which uses kixtart.form as well crashes after loading the Classes.
KixOmatic uses the object in 2 separate instances, one for the progressbar and one for the main form.
The progresbar doesn't crash but the main form does, right after loading the classes.

Apparently this error happens for a lot more programs in the creators update.


ShawnAdministrator
(KiX Supporter)
2017-04-21 03:35 AM
Re: Fatal exception occurred

I don't have Creators Update yet and by the sounds of it, don't think I want it on my real machine yet ;\) I'm going to create a VM with this update and try to reproduce the issue as a first step.

Is there a chance that MS will fix this issue on their end ? or did they deprecate something ? (Still reading up on this stuff).

-Shawn


AllenAdministrator
(KiX Supporter)
2017-04-21 05:24 AM
Re: Fatal exception occurred

Here's a well timed article that just came up after you posted Shawn
https://www.neowin.net/news/microsoft-re...irtual-machines


Arend_
(MM club member)
2017-04-21 11:08 AM
Re: Fatal exception occurred

Thanks for stopping by Shawn \:\)
I haven't read anything on Microsoft's side regarding this issue.
Allen: great link!! \:D


Arend_
(MM club member)
2017-04-21 11:38 AM
Re: Fatal exception occurred

 Originally Posted By: Allen
I've never installed any version other than kixforms classic. I realized that the message said it wanted .net, but I never used that, so it was just as confusing to me as to why it wanted it.


Sorry for spotting this too late, but essentially the script wanted kixforms.net
You can see it in the code, the difference is in the object.
kixtart.system = KiXforms Classic
kixforms.system = KiXform .Net

Most likely you had a .Net version of Kixomatic (I've translated it a while back)
Your code probably has this:
 Code:
$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf


BradV
(Seasoned Scripter)
2017-04-21 11:40 AM
Re: Fatal exception occurred

I have been having a horrible problem on my Windows 10 Home workstation after the creators update. A lot of times, the network connection just fails. At first I thought they had done something to disable firefox, but IE didn't work either. Then I noticed that I could not reach my mail server. That is internal at my house. It isn't always the case, just now and then. Very frustrating. \:\(

Arend_
(MM club member)
2017-04-21 11:43 AM
Re: Fatal exception occurred

 Originally Posted By: BradV
I have been having a horrible problem on my Windows 10 Home workstation after the creators update. A lot of times, the network connection just fails. At first I thought they had done something to disable firefox, but IE didn't work either. Then I noticed that I could not reach my mail server. That is internal at my house. It isn't always the case, just now and then. Very frustrating. \:\(


I doubt this has to do with the Creators Update, I have been having similar problems with Windows 10 from the start. Folders that are open in Explorer that point to folders on mapped drives disconnect all the time as well. And sites I'm logged in to using Chrome such as my monitoring system require me to login a couple of times a day.
I think W10 disconnects idle sessions or something.


AllenAdministrator
(KiX Supporter)
2017-04-21 03:39 PM
Re: Fatal exception occurred

Arend you are correct. I had select kixomatic2 instead of kixomatic... and the versions do translate to classic vs .net.

With that said, I tried installing what I think is the latest .net version of kixforms and it's saying it needs .net 1.1, Is that correct?


ShaneEP
(MM club member)
2017-04-21 03:52 PM
Re: Fatal exception occurred

I know there's probably no way this changes anything. But has anyone tried running DoEvents(1) with the async option? I have a vague memory of that fixing someones issue in the past. Even though this is probably a much bigger problem. Just currious if it get different results...

 Code:
$System = CreateObject("KiXtart.System")
$Form = $System.Form()
$Form.Show()
While $Form.Visible
   $Nul = Execute($Form.DoEvents(1))
Loop
Exit 0


Arend_
(MM club member)
2017-04-21 03:56 PM
Re: Fatal exception occurred

 Originally Posted By: Allen
Arend you are correct. I had select kixomatic2 instead of kixomatic... and the versions do translate to classic vs .net.

With that said, I tried installing what I think is the latest .net version of kixforms and it's saying it needs .net 1.1, Is that correct?


I think the latest version of KiXforms .net runs on .Net Framework 2.0


Arend_
(MM club member)
2017-04-21 03:56 PM
Re: Fatal exception occurred

 Originally Posted By: ShaneEP
I know there's probably no way this changes anything. But has anyone tried running DoEvents(1) with the async option? I have a vague memory of that fixing someones issue in the past. Even though this is probably a much bigger problem. Just currious if it get different results...

 Code:
$System = CreateObject("KiXtart.System")
$Form = $System.Form()
$Form.Show()
While $Form.Visible
   $Nul = Execute($Form.DoEvents(1))
Loop
Exit 0


Yeah tried that, but still no dice.
It did get by some hangs, but would crash eventually anyway.


AllenAdministrator
(KiX Supporter)
2017-04-21 04:58 PM
Re: Fatal exception occurred

On Windows 10 1703, if I use the kixforms301.msi this is the error I get...

 Quote:
This setup requires the .NET Framework versaion 1.1.4322. Please install the .NET Framework and run this setup again. The .NET Framework can be obtained from the web. Would you like to do this now?


Clicking the link takes you to a ms website but not 1.1 .NET. My understanding is, .NET 1.1 wont install on Win 10 anyway. So in my Programs and Features I see that I have the .Net 3.5 (includes 2.0) installed.

I extracted the dll and tlb files from the msi and copied the files to system32. Then I ran the following command:

 Code:
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\regasm kixforms.system.dll


Said "Types Registered Successfully"

However, when I run kixomatic.net i still get "Kixforms.net Not Initiated. This Script Will now Close."



Any suggestions?



AllenAdministrator
(KiX Supporter)
2017-04-21 05:27 PM
Re: Fatal exception occurred

Got it working. Copied the kixforms files to syswow64 and ran the 32bit version of regasm.

Arend_
(MM club member)
2017-04-21 05:28 PM
Re: Fatal exception occurred

Last KiXform .Net version that I have is 3.2.16.
Afaik that runs on .net 2.0.


AllenAdministrator
(KiX Supporter)
2017-04-21 05:42 PM
Re: Fatal exception occurred

Download link for 3.2?

Arend_
(MM club member)
2017-04-21 07:32 PM
Re: Fatal exception occurred

From 3.2.5 .Net 1.1 was dropped in favor of .Net 2.0.
Last version can be found here


Arend_
(MM club member)
2017-04-24 04:10 PM
Re: Fatal exception occurred

Small update: If you boot into Safe Mode, KiXforms 2.47.5 works without issue.
So it seems to be some kind of DEP (Data Execution Prevention) that got added in the Creators Update.
I've completely disabled Windows Defender, Smart Screen etc. but the problem still exists in "Normal Mode".
I've even freshly installed a laptop with the Creators Update ISO to make sure it wasn't the 'Upgrade' process that caused the problem.

Now the good news: Shawn is working on a version that has a workaround for the problem and it seems to work.


NTDOCAdministrator
(KiX Master)
2017-04-29 06:13 AM
Re: Fatal exception occurred

Who is this imposter?

Welcome Shawn - if but for a brief moment in time. Hope all is going well for you

Cheers

Ron


ShawnAdministrator
(KiX Supporter)
2017-05-02 03:45 AM
Re: Fatal exception occurred

Hi Ron, really glad to hear from you, all is going well.

Kix on, my brother !

-Shawn


NTDOCAdministrator
(KiX Master)
2017-05-02 07:10 PM
Re: Fatal exception occurred

You're coming up on your 18 year anniversary on the forum here in about 3 months. You've been around on this forum longer than many have been in IT Shawn.

ShawnAdministrator
(KiX Supporter)
2017-05-02 11:57 PM
Re: Fatal exception occurred

LOL!, ahhhhhhyeaaaa, thanks for reminding me of that buddy ;\)

PrebenJ
(Just in Town)
2017-05-18 04:03 PM
Re: Fatal exception occurred

Would be really nice if Kixforms Classic could run on the latest Windows 10 Creators Update - I can confirm the problem as well as it stopped working on the new computers we deploy when entering the DoEvents loop.

/Preben


JochenAdministrator
(KiX Supporter)
2017-05-24 07:04 PM
Re: Fatal exception occurred

\:\(

Ruud van Velsen
(Hey THIS is FUN)
2017-06-02 10:49 AM
Re: Fatal exception occurred

Hi Shawn,

any luck with repro'ing/investigating this issue?

Cheers,

Ruud


ArserHsieh
(Fresh Scripter)
2017-06-18 06:49 AM
Re: Fatal exception occurred

Hi Sir,
I have the same issue, but I post in the suggested area, is there any update?
thank you~


ShawnAdministrator
(KiX Supporter)
2017-06-21 09:10 PM
Re: Fatal exception occurred

Hi Ruud.

I've got to learn to check into Korg more often ;\)

Yes, I've managed to reproduce the issue on Creators Update, and I have released a fixed version that has been tested successfully by a few members. In fact, the Original Poster of this thread is back in business. So I guess it could be published soon.

In terms of the root cause, I saw some strange new behaviors in Creators Update, around Windows messages in the Message Queue. Specifically, a message containing a handle to a Window that doesn't exist anywhere in the system (or at least not owned by Kixforms and doesn't show up in Windows Spy). This was the root cause of the issue. I can email you specific details if you're interested.

Thanks!
-Shawn


AllenAdministrator
(KiX Supporter)
2017-06-21 09:36 PM
Re: Fatal exception occurred

 Quote:
I've got to learn to check into Korg more often ;\)


Thanks for checking in Shawn. Sure wouldn't hurt my feelings if you came around more \:\)


Glenn BarnasAdministrator
(KiX Supporter)
2017-06-22 02:45 AM
Re: Fatal exception occurred

Your knowledge, experience, and friendship are sorely missed, Shawn!

I have a TON of KF GUI and non-GUI apps that I can now test with a fresh CU build. I use KF in several service-based apps, particularly with timers and TCP/IP, so can test a wide variety of methods.

Glenn


Mart
(KiX Supporter)
2017-06-22 02:32 PM
Re: Fatal exception occurred

Great. Planning a transfer to Windows 10 so this will most likley fix one of the issues we have with Windows 10 and some of the applications we have developed.

Will you be relasing the updated version in an MSI package? I can get the DLL here but an MSI package would be great.


Bonji
(Starting to like KiXtart)
2017-06-22 07:50 PM
Re: Fatal exception occurred

I'm so thankful you found/fixed the problem Shawn. I do most new coding in PowerShell since I have native access to a GUI (plus all the cool stuff it does), but Kixforms Classic is the only GUI I can use on every Windows computer we have (lots of WinXPe still around).

I was not looking forward to figuring out an alternative to Kixforms. Thanks!!!!!


Glenn BarnasAdministrator
(KiX Supporter)
2017-06-23 02:28 AM
Re: Fatal exception occurred

Just an update - I built the creators update platform and deployed our standard management/monitoring/maintenance suite to it. This includes 2 GUI apps, 4 or 5 non-GUI apps that use KF for advanced processing, and about 20 other Kix apps.

Initial testing shows that both GUI apps are working as expected. The full suite of tools will kick off with tomorrow's daily maintenance cycle. I'll be manually testing the service apps to insure that they work properly in the next few days.

So far, things look good with the new version!

Glenn


AllenAdministrator
(KiX Supporter)
2017-06-23 05:18 AM
Re: Fatal exception occurred

\:\)

Glenn BarnasAdministrator
(KiX Supporter)
2017-06-30 12:02 AM
Re: Fatal exception occurred

So - our maintenance and Smart Monitor tools have been deployed on the test system and running for about a week now, with maintenance running for the past 4 days. All tools that we've deployed are working as expected on the Creator's Update with the updated KF DLL. The user interface and sub-forms as well as our other GUI tools work, and the tools that don't use the GUI are also functional.

Thanks, Shawn!!

Glenn


anglerzac
(Just in Town)
2017-08-15 12:00 PM
Re: Fatal exception occurred

Hello, We are in process of updating a large 2008 terminal server environment to server 2016 if possible but were going to have to go with 2012r2 simply because of this issue.
Is the fix for Windows 10 (and Server 2016 I presume) available for testing or public release?


ShaneEP
(MM club member)
2017-08-15 03:30 PM
Re: Fatal exception occurred

Looks like Shawn posted a link to the updated kixforms dll in the following thread.

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=212545


And here is the direct link if you'd like to skip directly to it.

https://1drv.ms/u/s!AvPqNN0hts2kggfYaMnPPjH15HqH


anglerzac
(Just in Town)
2017-08-16 04:03 PM
Re: Fatal exception occurred

Thank you thats great.

VeePee
(Just in Town)
2017-10-11 05:54 PM
Re: Fatal exception occurred

Hi all,

It seems that the link above to get creators update of kixforms.dll to fix w10 1703 issue does not work

https://1drv.ms/u/s!AvPqNN0hts2kggfYaMnPPjH15HqH

This site can’t be reached

The webpage at https://onedrive.live.com/redir?resid=A4CDB621DD34EAF3!263&authkey=!ANhoyc8-MfXkeoc might be temporarily down or it may have moved permanently to a new web address.
ERR_TUNNEL_CONNECTION_FAILED

Br,
-Vesa


JochenAdministrator
(KiX Supporter)
2017-10-11 07:11 PM
Re: Fatal exception occurred

Hi Vesa,
seems to work (again).
Let me know if this is the case for you too