C++ Runtime Error

Found a bug in EventGhost? Report it here.
Bernhard
Posts: 10
Joined: Tue Jan 08, 2019 12:28 am

C++ Runtime Error

Post by Bernhard » Tue Jan 08, 2019 12:34 am

Hi,

no idea if it's a bug or not, but I didn't see a lobby for error-reporting, so I try it here..

I use EventGhost 0.4.1.r1722 to start a program by a joystick button. So the only plubin being loaded is "Joystick".

Then there is only one node - to start a given programm if a given joystick button is pressed. Normally that works perfectly fine and I am super happy that this feature is possible by using eventghost.

However, quite often I receive a MS Visual C++ Runtim Error. Message: "This application has requested the Runtime to terminate it in an unusual way. Please contact the app support team...

I copy the info I found in the windows event log:

Name der fehlerhaften Anwendung: EventGhost.exe, Version: 0.4.1.1722, Zeitstempel: 0x4918019c
Name des fehlerhaften Moduls: PYTHON26.DLL, Version: 2.6.5150.1013, Zeitstempel: 0x4ba43271
Ausnahmecode: 0x40000015
Fehleroffset: 0x000fab2b
ID des fehlerhaften Prozesses: 0x2a60
Startzeit der fehlerhaften Anwendung: 0x01d4a61eaf5997a4
Pfad der fehlerhaften Anwendung: C:\Program Files (x86)\EventGhost\EventGhost.exe
Pfad des fehlerhaften Moduls: C:\Program Files (x86)\EventGhost\PYTHON26.DLL
Berichtskennung: 4b558a47-c75f-41d9-966a-f5072675f524
Vollständiger Name des fehlerhaften Pakets:
Anwendungs-ID, die relativ zum fehlerhaften Paket ist:

I run iRacing - a racing simulator when starting Multiscreen Blank v2 via the button of a buttonbox by using EventGhost. During that sometimes this errors happens and obviously EventGhost stopps working.

Any ideas?

regards,
Bernhard

User avatar
kgschlosser
Site Admin
Posts: 4506
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: C++ Runtime Error

Post by kgschlosser » Tue Jan 08, 2019 7:37 am

OK what i can see happening here is this.

If you have a game started by a joystick button that means that EG is connected to the joystick. when the game starts it too is going to try to access the joystick. from what i am gathering is they might be bumping heads.

Easy way to handle this is to install the Task Monitor plugin. this will generate events when application start and stop.

you are going to need to create 2 macros. one for the process creation event that occurs when you start the game and the second for then the process ends when you close the game.

in the macro that has the event for when the game starts you are going to want to add the Disable Action. point that action to the Joystick plugin. and in the macro for when the game stops add the Enable action. point that action to the plugin as well.

so what this is going to do is it is going to disable the Joystick plugin which will disconnect EG from the physical joystick. and when the game ends it is going to enable the plugin which will reconnect EG to the physical joystick.

hopefully this will stop the bumping of heads between the game and EG trying to access the joystick at the same time..
If you like the work I have been doing then feel free to Image

Bernhard
Posts: 10
Joined: Tue Jan 08, 2019 12:28 am

Re: C++ Runtime Error

Post by Bernhard » Tue Jan 08, 2019 10:02 pm

kgschlosser wrote:
Tue Jan 08, 2019 7:37 am
OK what i can see happening here is this.

If you have a game started by a joystick button that means that EG is connected to the joystick. when the game starts it too is going to try to access the joystick. from what i am gathering is they might be bumping heads.

Easy way to handle this is to install the Task Monitor plugin. this will generate events when application start and stop.

you are going to need to create 2 macros. one for the process creation event that occurs when you start the game and the second for then the process ends when you close the game.

in the macro that has the event for when the game starts you are going to want to add the Disable Action. point that action to the Joystick plugin. and in the macro for when the game stops add the Enable action. point that action to the plugin as well.

so what this is going to do is it is going to disable the Joystick plugin which will disconnect EG from the physical joystick. and when the game ends it is going to enable the plugin which will reconnect EG to the physical joystick.

hopefully this will stop the bumping of heads between the game and EG trying to access the joystick at the same time..
Hi Kgschlosser,

thx for your reply. Some of it is a bit over my head at the moment. But before I start trying to work myself through your suggested solution I'd like to check on a few details first:

- I don't start a game with the joystick button. I use an otherwise unused button of a button box while being in the game to have the Multiscreen Blank tool started by EventGhost. At least this button is not used otherwise. The buttonbox itself is, but rather seldom and those buttons never at the same time.

- I do need to have EventGhost and the action for this running WHILE in being in the sim - that's the whole point of using EventGhost to bind a buttonbox button to start the Multiscreen Blank tool.

Strange thing is also that it does work most of the times, but seems to stop for no obvious reasons. At least at the moment I have no clue why..

So I am not sure if your solution - despite the fact I don't fully understand it - may work here for me?

User avatar
kgschlosser
Site Admin
Posts: 4506
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: C++ Runtime Error

Post by kgschlosser » Wed Jan 09, 2019 12:55 am

you are telling me you are using the Joystick plugin. if you are using that plugin then you are using a Joystick. whether it is a "button box" or not it is still a Joystick. It interfaces to your computer as a Joystick.
I do need to have EventGhost and the action for this running WHILE in being in the sim - that's the whole point of using EventGhost to bind a buttonbox button to start the Multiscreen Blank tool.
what what does this do? Multiscreen Blank tool.
I run iRacing - a racing simulator when starting Multiscreen Blank v2 via the button of a buttonbox by using EventGhost. During that sometimes this errors happens and obviously EventGhost stopps working.
This is a game. games access Joysticks. 2 programs cannot access the same piece of hardware at thee same time. Joysticks are something that are exclusive. meaning you cannot share the Joystick. A sound Card can be shared. but only one can use it at a time. it switches back and forth so fast you would never know it. Unfortunately this cannot take place with a joystick.

from you description it sounds like you start the Multiscreen Blank program with the use of the button box (joystick) and when that launches it launches a game called iRacing . whether you directly start the game or not from EG doesn't matter. the point is the game starts as a result of you pressing a button on that button box.
If you like the work I have been doing then feel free to Image

Bernhard
Posts: 10
Joined: Tue Jan 08, 2019 12:28 am

Re: C++ Runtime Error

Post by Bernhard » Sat Jan 12, 2019 12:12 pm

It's a bit different:

I start the simulation (iRacing) = the game.

During the simulation I use wheels, buttonboxes, shifters = joysticks.

There are other programs which can use/access buttons of the buttonboxes/joystick and perform actions by doing so parallel to the simulation and I am using them without issues (one is a tool called JRT, another is Crew Chief, another is TeamSpeak, so there are plenty..). I don't understand the technical background, but it's possible to use joysticks by various programs at the same time.

I do not use the button to start the game, I use joystick buttons to trigger actions DURING the game. Again, also with other tools, the most known one being teamspeak probably. Where push to talk buttons and other functions are bound to joystick buttons to be used parallel to the game as well.

I try to use EventGhost to start the tool MultiScreenBlank2 by a joystick button. MultiScreenBlank2 is then blanking and revealing one of the 4 screens attached (showing simulation details).

This also works most of the time, but sometimes it suddenly crashes and so far sadly I have no clue why sometimes this error is provoked. Sadly it's a no-go for serious Endurance racing as the simulation gets compromised by the errormessage (focus is taken away and the simulation turns from full screen mode spanned over 3 monitors via nvidia surround into single window mode - which makes driving impossible.

So for casual practicing and I am still using the setup with EventGhost, but it's not possible for serious usage at the moment..

Bernhard
Posts: 10
Joined: Tue Jan 08, 2019 12:28 am

Re: C++ Runtime Error

Post by Bernhard » Sat Jan 12, 2019 3:35 pm

sadly, sadly it still happened with very, very bad consequencies.. The error message took away focus from the sim and ruined my 4h Nordschleifen VLN Endurance Race today, which also means that the racing series is done for me (I was fighting for podium..) : (

I had EventGhost closed as I new it might trigger an error message and I did not want to risk this during an official important race event. It was not shown in the task menu, but obviously the process was still running somehow.. At least in the windows event viewer it is the application which caused the crash.. : (

It would be reall great if I could use it because as long as it works fine - it does exactly what I am looking for. But those error messages crashing the sim are a no go.. : (

- System

- Provider

[ Name] Application Error

- EventID 1000

[ Qualifiers] 0

Level 2

Task 100

Keywords 0x80000000000000

- TimeCreated

[ SystemTime] 2019-01-12T15:11:51.145493900Z

EventRecordID 7951

Channel Application

Computer SIM-RIG

Security


- EventData

EventGhost.exe
0.4.1.1722
4918019c
PYTHON26.DLL
2.6.5150.1013
4ba43271
c0000005
000a77ac
2458
01d4aa727de85a92
C:\Program Files (x86)\EventGhost\EventGhost.exe
C:\Program Files (x86)\EventGhost\PYTHON26.DLL
83443663-bc2a-4b60-bae3-c9340d87ffa7

User avatar
topix
Experienced User
Posts: 440
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: C++ Runtime Error

Post by topix » Mon Jan 14, 2019 5:08 pm

Maybe you can give EventGhost 0.5.0-rc6 a test drive?

User avatar
kgschlosser
Site Admin
Posts: 4506
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: C++ Runtime Error

Post by kgschlosser » Tue Jan 15, 2019 3:05 pm

I also did a new build of the extension module that is used by the Joystick plugin. You can try and see if the updated one will work for ya. I do not remember when the last time this may have been compiled. so you could be having the issue because of the age of it.

make a backup of c:\program files (x86)\eventghost\lib26\site-packages\_dxJoystick.pyd

You can give it a shot and see what happens. you will need to uncompress the attached file into

Code: Select all

c:\program files (x86)\eventghost\lib26\site-packages
Attachments
_dxJoystick.zip
(7.4 KiB) Downloaded 4 times
If you like the work I have been doing then feel free to Image

Bernhard
Posts: 10
Joined: Tue Jan 08, 2019 12:28 am

Re: C++ Runtime Error

Post by Bernhard » Sat Jan 19, 2019 10:06 pm

Thx for the tips. It took some time to check both. Sadly both of them - either EventGhost 0.5.0-rc6 or the new dxJoystick.zip did not help.

It works for quite some time, but eventually an application error crashes the simulation. It's a pitty because till then it works absolutely fine and does exactly what I as looking for, but those errors happening occasionally is a no go for my use case in the background of a simulation if it causes it to crash to desktop. I could life if it just stopps working, but crashing the simulation is a no go. : (

User avatar
kgschlosser
Site Admin
Posts: 4506
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: C++ Runtime Error

Post by kgschlosser » Sun Jan 20, 2019 12:19 am

hmmm...

because it is an application crash and not a python error trying to find the cause is going to be very difficult.

I am going to look at the source code for the joystick extension DLL (PYD) file and see if there is some way I can port the code to make a pure python connector instead.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4506
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: C++ Runtime Error

Post by kgschlosser » Sun Jan 20, 2019 10:33 am

ok so i spent some time on this. and about 1800 lines of code later I believe I may have a pure python version of the joystick plugin.

It is a direct replacement for the existing one.

I also expanded it in the process.

it supports up to 32 buttons. events for pressed and released
it now support 6 axis joysticks. x, y, z, r, u, v
It also support POV in degrees -1 being centered.
you will get device added and removed events when plugging and unplugging a joystick

I have not been able to test it because I do not own a joystick. if you want to give it a test run it is attached. It does install properly into EG 0.5
Attachments
Joystick-2.0.0.egplugin
(15 KiB) Downloaded 4 times
If you like the work I have been doing then feel free to Image

Bernhard
Posts: 10
Joined: Tue Jan 08, 2019 12:28 am

Re: C++ Runtime Error

Post by Bernhard » Sun Jan 20, 2019 10:20 pm

Thank you very much trying to look into this! I appreciate your efforts. Would be great if I could use it and I guess plenty of other simracers might find it helpfull to make better use of their button boxes.

Yes, sadly the error message does not seem to give lot of details/clues of what actually is going wrong here. I can imagine it's almost impossible to figure out what's happening.

Ah I just read your last post. Of course, I am happy to give it a try!

I currently have the beta version installed topix suggested. Can I keep that, or should I install another stable version instead?

And how do I install/use this plugin? I double clicked, it asked if I want to have it installed and then there was no further message. Can I check if it's correctly installed?

Bernhard
Posts: 10
Joined: Tue Jan 08, 2019 12:28 am

Re: C++ Runtime Error

Post by Bernhard » Sun Jan 20, 2019 10:26 pm

Hm, I think it installed itself, because EventGhost seems not to work anymore with my buttonbox/joystick. At least there are no button events being logged/recognized any more. Maybe I have to do something in order to make it work again?

User avatar
kgschlosser
Site Admin
Posts: 4506
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: C++ Runtime Error

Post by kgschlosser » Sun Jan 20, 2019 11:18 pm

you do have it installed correctly. I am going to have to add some lines into it for debugging purposes to see what is going on. Did you get any errors at all??
If you like the work I have been doing then feel free to Image

Bernhard
Posts: 10
Joined: Tue Jan 08, 2019 12:28 am

Re: C++ Runtime Error

Post by Bernhard » Mon Jan 21, 2019 10:16 pm

Hi, no output at all.

Normally I saw the joystick button activities being logged in eventghost, but now there is nothing going on no matte which joystick/button I am pressing.

Post Reply