Application Error - The application was unable to start correctly (0xc0000142)

Hi,
Just compile my app but at the end there’s an error said " The application was unable to start correctly (0xc0000142).click Ok to close the application "
Does anyone can help?

thx,

Joe

Perform Google search for that error code.

from the google tells me it is about the compatibility app issue…I’ve try their solution but the problem still appear…

The following may not be the solution, but worth a try…

Try including the Manifest on the app.
Secondly, I had a similar issue where the application icon was set to window xp compatibility.

Regards

what does the manifest mean?

thx

https://www.collinsdictionary.com/dictionary/english/manifest :joy:

It’s a file that provides information to windows.
https://docs.microsoft.com/en-us/windows/desktop/sbscs/application-manifests
In clarion the manifest can be created from the exe app its one of the tabs in the app.

1 Like

Hi, it is late for this answer but I wish to leave a note.
I had this same exception when in a NON data dll I declared globally a local file (so without external) and with NAME attribute being a non threaded variable, external from data dll
If variable for NAME is not external or if it is threaded then it is ok.
Go figure why.

After 4 hours of debugging I found my own post. Nice work ncik

1 Like

Today after changes got the error:

Benefits.exe - Application Error
The application was unable to start correctly (0xc0000142). Click OK to close the application.

I had converted an APP that made an EXE to make a DLL. When I tried to call the DLL from an EXE I got the error when running. I finally got around to checking all the Global Embed code, something I should have done as sooner. I noticed this embed and said ahhh…

image

The FIXED command in the EXP removed the Relocation table. That’s fine for an EXE because it always loads first. This DLL was built at the default address 400000h which is also used by the EXE so the DLL fails to load and causes this error.

Removing FIXED solved the error. I would guess few people use FIXED so it would not be the cause of this error. I wanted to post this as an FYI that the error can be caused by a failure to load the DLL.

Also as a reminder if you convert from EXE to DLL to check your Global Embeds and Extensions.

In addition, you might need to check the synching of the GlobalErrors and IniMgr objects. I think I had to do this manually in C6 so that all of the dlls and the exe were using the same GlobalErrors and IniMgr. Normally, that’s handled in the .EXE, but if you handcode the EXE, it’s not handled automatically :slight_smile:

After converting a C5 App to 11.1 this Application Error appeared.

Reviewed Project to see if anything jumped out at me. Noticed new 11.1 setting for DEP (Data Execution Prevention) so turned that OFF. Compiled and then it ran without the error. Be aware DEP is turned ON by default in 11.1 and last two 11.0 releases.

I suspect it is one of the DLLs it is using, will follow up if I find it. Also wondering how to track it down. Maybe will show something in Windows Event Viewer, or in Dependency Walker profiler.

image

Edit: Event Viewer did log an Application Error 0xC0000005 for aiHtml.DLL so will look into getting a newer DLL:

1 Like