|
Post by Lombra on Sept 24, 2017 13:07:51 GMT
Haven't quite narrowed down the issue yet. Was hoping for some hints here, if possible.
Under what circumstances would the aforementioned message pop up? Sometimes (?) followed by "Creation of dummy window failed". I've narrowed it down to being related to disabled vJoy devices. Specifically, calling isVJDExists and/or GetVJDStatus for a disabled device. Seemingly only the first time I do so during my feeder application lifetime.
|
|
|
Post by Shaul (Admin) on Sept 27, 2017 6:43:10 GMT
Here is an explanation of the mechanism I've used for the vJoy API interface: There is a Dummy (hidden) Window that serves as a hub for the API. This window is not created when loading the DLL but rather when it is first needed. Here are a few cases when this window is created: - When acquiring a vJoy device (AcquireVJD)
- When getting driver status (GetvJoyMaxDevices, vJoyFfbCap, GetNumberExistingVJD)
Since you report cases of failure to create this window, the problem is not that it is missing but that it cannot be created. When creating a window, the system function RegisterClassEx() is called. If it fails you get "Call to RegisterClassEx failed!" - I can't see why. Consequently, you get "Creation of dummy window failed!".
AFAIK, this does not cause the feeder to crash so you can probably just ignore it.
Sorry for the late reply, I move on to other projects so I have less time to support vJoy.
|
|
|
Post by Lombra on Jul 2, 2018 18:33:30 GMT
I have returned to my project and decided to look into this issue again. I believe I have pinpointed the issue. It was not related to disabled devices after all. Instead it was a result of calling isVJDExists twice asynchronously. The following program reproduces it consistently on both my Windows 7 and 10 64 bit systems.
using System; using System.Threading.Tasks; using vJoyInterfaceWrap;
namespace vJoyFeederDebugger { class Program { static public vJoy joystick = new vJoy();
static void Main() { Task.Run(() => joystick.isVJDExists(1)); Task.Run(() => joystick.isVJDExists(1));
Console.WriteLine("Press Enter to continue..."); Console.ReadKey(true); } } }
Is this something that can reasonably be fixed, or should I look into solving it on my end?
|
|
|
Post by Shaul (Admin) on Jul 2, 2018 18:56:26 GMT
The API is not thread-safe.
|
|