roa Posted August 19, 2020 Report Share Posted August 19, 2020 Hi Pete, Do you know if there is a common folder location we can use for the new MSFS Simconnect.dll? Or must every Simconnect client app has its own Simconnect.dll in the folder where the exe for the app is located? Link to comment Share on other sites More sharing options...
Pete Dowson Posted August 19, 2020 Report Share Posted August 19, 2020 24 minutes ago, roa said: Do you know if there is a common folder location we can use for the new MSFS Simconnect.dll? Or must every Simconnect client app has its own Simconnect.dll in the folder where the exe for the app is located? Up till now every 64-bit SimConnect application would need the DLL in the same folder. It might work okay by putting it in C:\Windows or one if the folders within. But I think this not worthwhile as things should change. The next release of FSUIPC7-Beta will not need access to the DLL as MS have now released the static library which can be compiled into our program. I expect this change to be taken up by any other 64-bit programs using SimConnect. 32-bit programs like LittleNavMap can quite happily use the old FSX SimConnect installs. Pete Link to comment Share on other sites More sharing options...
roa Posted August 19, 2020 Author Report Share Posted August 19, 2020 OK, Thanks for the tip on the static library. I will use that in my code from now on. Link to comment Share on other sites More sharing options...
John Dowson Posted August 19, 2020 Report Share Posted August 19, 2020 FYI, I have just updated FSUIPC7-Beta. It is now built against the static lib, so the dll is no longer required. Link to comment Share on other sites More sharing options...
roa Posted August 19, 2020 Author Report Share Posted August 19, 2020 John, could you give me a hint on how to compile the static library into a C# program to avoid that the user must have the Simconnect.dll in the app folder.. I though I new how to do it, but was wrong. I have added Microsoft.FlightSimulator.Simconnect.dll to my Reference and have a "using Microsoft.FlightSimulator.SimConnect; in my managed code c# Link to comment Share on other sites More sharing options...
Pete Dowson Posted August 19, 2020 Report Share Posted August 19, 2020 2 hours ago, roa said: John, could you give me a hint on how to compile the static library into a C# program to avoid that the user must have the Simconnect.dll in the app folder.. I though I new how to do it, but was wrong. I have added Microsoft.FlightSimulator.Simconnect.dll to my Reference and have a "using Microsoft.FlightSimulator.SimConnect; I think I can answer that for John. The static library provided in the latest SDK is for native code programs. I'm afraid it cannot be used with Managed programs. Pete Link to comment Share on other sites More sharing options...
roa Posted August 20, 2020 Author Report Share Posted August 20, 2020 But, the Microsoft.Flightsimulator.Simconnec.dll in the SDK's \lib\managed\ folder. I use this in my managed code and it is working, but I still need the SimConnect.dll in my app folder. I thought this was the static library that could be embedded in the app code, but probably misunderstood. I see now that you meant the SimConnect.lib. Bear with my questions, as I am just a hobby programmer. I find it odd that if all apps that use managed code should need to have the SImConnect.dll included in the app folder to work. There must be a common folder that can be used or a way to embed the dll. Link to comment Share on other sites More sharing options...
John Dowson Posted August 20, 2020 Report Share Posted August 20, 2020 2 minutes ago, roa said: There must be a common folder that can be used or a way to embed the dll. You can try putting the dll in the Windows system folder (and reboot), but this really should be done by the SDK installer (and would then also require users of your software to also install the SDK!). The way to embed the dll is to use a static library. Seems like Asobo only provided a static library for unmanaged C/C++, maybe a static library for managed code will come later. I think for now, you should just include the SimConnect.dll along with your application. John Link to comment Share on other sites More sharing options...
Thomas Richter Posted August 20, 2020 Report Share Posted August 20, 2020 Hi, just in addition to John's answer. Managed languages like C# / VB.net cannot link static libraries, only DLL's can be linked. Thomas Link to comment Share on other sites More sharing options...
Pete Dowson Posted August 20, 2020 Report Share Posted August 20, 2020 3 hours ago, roa said: But, the Microsoft.Flightsimulator.Simconnec.dll in the SDK's \lib\managed\ folder. I use this in my managed code and it is working, but I still need the SimConnect.dll in my app folder Seems, then, that the Managed DLL accesses MSFS via the unmanaged DLL. Very convoluted! At least MS has now given permission for you to include both DLLs in your packaging. Pete Link to comment Share on other sites More sharing options...
earthdog Posted August 25, 2020 Report Share Posted August 25, 2020 On 8/19/2020 at 10:09 PM, roa said: John, could you give me a hint on how to compile the static library into a C# program to avoid that the user must have the Simconnect.dll in the app folder.. I though I new how to do it, but was wrong. I have added Microsoft.FlightSimulator.Simconnect.dll to my Reference and have a "using Microsoft.FlightSimulator.SimConnect; in my managed code c# I suppose you could use Fody/Costura to embed the managed DLL in your app... Link to comment Share on other sites More sharing options...
CAG2 Posted September 5, 2020 Report Share Posted September 5, 2020 On 8/20/2020 at 7:44 PM, Pete Dowson said: At least MS has now given permission for you to include both DLLs in your packaging. @Pete Dowson May I ask where you got this information? Link to comment Share on other sites More sharing options...
John Dowson Posted September 5, 2020 Report Share Posted September 5, 2020 5 hours ago, CAG2 said: May I ask where you got this information? It was posted on the MSFS beta third party forums. The latest SDK also contains instructions on how to copy the dll to your exe location via VS post build events. John 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now