No, because the library name is part of the symbol name. So in one class file you’d have (very simplified):
using Microsoft.FlightSimulator.Simconnect;
...
class MSFSConnection
{
private SimConnect _sc;
public bool Connect(System.IntPtr myWindow)
{
bool retVal = false;
try{
_sc = new SimConnect("My App Connection", myWindow, WM_USER_SIMCONNECT, null, 0);
retVal = true;
}catch(ComException) {}
return retVal;
}
}
And in another:
using LockheedMartin.Prepar3D.Simconnect;
...
class P3DConnection
{
private SimConnect _sc;
public bool Connect(System.IntPtr myWindow)
{
bool retVal = false;
try{
_sc = new SimConnect("My App Connection", myWindow, WM_USER_SIMCONNECT, null, 0);
retVal = true;
}catch(ComException) {}
return retVal;
}
}
Obviously you need to add both DLLs as dependencies in the project, which means they’ll both be included in the compiled output. You don’t need to worry about which one to copy.
For the user it’s just a matter of clicking “Connect to MSFS” or “Connect to P3D” (or however you want to make your UI). When you know which sim, you can call the appropriate routines (or you can call them through an abstract base class, which is more elegant, but a bit more work. )
The DLLs are very much not binary compatible. They implement the same interface is all, otherwise they should be regarded as totally different animals, at least internally.
By using two sims “in parallel”, if you mean running both at the same time, I don’t imagine that happens very often, not on the same computer anyway. Although across multiple PCs it could happen, especially in test or QA environments. This would only allow one connection at a time, but personally, I’ve never been asked to support simultaneous connections to multiple sims, so I don’t think it’s an issue. If you mean having both sims installed and switching between them at different times, then yes I think that’s likely. If you pay heed to the tantrum threads in this forum, then it may even be quite common (“waaah MSFS is rubbish, I’m going back to P3D/X-Plane/FSX/Legos…”)