To be honest I’d be surprised if that would work at all. Unless the actual protocol between client (“your app”) and server (“the flight simulator”) was also standardised - is it? - compatibility is usually only given (at the mercy of the vendor) between a given “product line”. So e.g. the “SimConnect.dll” (for simplicity’s sake I call them all “SimConnect.dll”, even though I noticed a couple of days ago that the one from Prepar3D v5 is apparently called “LockheedMartin.Prepar3D.SimConnect.dll”) from FSX might be binary compatible with later incarnations of “Flight Simulator” (including FS2020 perhaps?), and perhaps also with Prepar3D.
The “opposite” however might not necessarily true, so taking a “Prepar3D SimConnect.dll” and try to connect with FS 2020 might or might not work.
So when in doubt always take the DLL that ships with the actual flight simulator.