hkhoanguyen 1 Posted October 30, 2017 Report Share Posted October 30, 2017 Hi, I'm developing a small application with FSUIPC .NET, i dont know if it exists a way to check P3D is running or not? //Check P3D running Before starting Process() FSUIPCConnection.Process(); // Process the request to FSUIPC FSUIPCConnection.Process("AircraftInfo"); // For aicraft typ Thanks Quote Link to post Share on other sites
Paul Henty 67 Posted October 30, 2017 Report Share Posted October 30, 2017 You can use FSUIPCConnection.IsConnectionOpen() e.g.: if (FSUIPCConnection.IsConnectionOpen()) { FSUIPCConnection.Process(); // Process the request to FSUIPC FSUIPCConnection.Process("AircraftInfo"); // For aicraft type } However, you'll need version 3 of the DLL for this. It's not in the 2.4 version. I've attached it here. It requires .NET 4 or later, there is no build for earlier frameworks. If you don't want to upgrade then you'll need to keep track of the connection yourself. In the 2.4 download there is a sample application in C# which tracks the connection status by catching exceptions. Paul FSUIPCClient3.0_RC5.zip Quote Link to post Share on other sites
peterk54 0 Posted January 24, 2018 Report Share Posted January 24, 2018 Dear hkhoanguyen We use VB6. You may adopt to .NET our proposal. You can use the Windows API FindWindow and search for class "FS98MAIN". Take the hadle received to read with Windows API GetWindowText. The P3D windows does change from "Lockheed Martin® Prepar3D® v3 with WideServer: waiting for clients" to "Lockheed Martin® Prepar3D® v3 with WideServer: 1 connected" where 1 shows total clients connected. when this is up, P3D and FSUIPC do run properly. During flying check offset &H3F02, 2, VarPtr(FS_FLTSTN_RELOAD) against a variable xxx_OLD if it does increase. If it does, wait until reloaded with offset &H3365, 1, VarPtr(FS_MENUDIALOG_FLAG). Wait until not anymore 1 but 0. Reload all new data required into your application. Hope this assists. Regards Peter Quote Link to post Share on other sites
buick552 2 Posted October 31, 2018 Report Share Posted October 31, 2018 Hi, my answer will be with VB coding. Try OpenFSUIPC() FSUIPCConnection.Close() Catch ex As Exception FSUIPCConnection.Close() MsgBox("FSUIPC Not Found or FS is not running !") Exit Sub End Try ... ... You may continue your code blocks but if OpenFSUIPC produces an error, the SUB will be stopped due to error handling with a messagebox and the code will not be run anymore. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.