• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v4 Desperately trying to make SimConnect with C ++ work in managed code

Thanks a lot,
I have tried it before, it compiles and works nicely but is linked with a FSW simconnect.lib and Dovetail Simconnect.dll on the executable folder.
Does not link with p3d simconnect.lib, however i'm not sure to have such extension, will give a try.

Most simple C++ programs convert easily to Managed C++ by just changing the compiler directives. Google IJW (it just works).
 
Thanks a lot, i have routed these tracks:
1. using this:
https://blogs.msdn.microsoft.com/abhina ... ogramming/
tried to mix managed and unmanaged code using compiler directive as suggested also by you, it compiles but does not link with unmanaged LM SimConnect.Debug.lib or SimConnect.lib
2. as suggested installing C++/CLR Windows Form for Visual Studio 2017, same as above, your FSW_Slew works nicely since is linked with Dovetail SimConnect.lib which obviously does not work in P3D.

so i'm again stuck, but won't give up.
/Mario
 
[SOLVED]
Thanks to Benjamin Erd i have now corrected my code and it works, so i have nice managed SimConnect C++ code.
2 fix to do to code:
Code:
Sim_Connect = gcnew SimConnect(safe_cast<String^>("tf104gconfig"),this->Handle, WM_USER_SIMCONNECT, nullptr, 0);
and
Code:
this->simConnect->OnRecvOpen += gcnew SimConnect::RecvOpenEventHandler(this, &MainForm::OnRecvOpen);
being OnRecvOpen a private method in Main Form:
Code:
void MyForm::OnRecvOpen(SimConnect ^sender, SIMCONNECT_RECV_OPEN ^data)    {    
MessageBox::Show("OnRecvOpen called");   
 }
available to send in pm the solution for Visual C++ 2017 Community.
Thanks to all, even to those who, instead of helping, have insulted me.
/mario
 
Glad you got it fixed. Sorry we couldn't be more helpful.
Thanks,
i have set HERE the complete managed C++/SimConnect solution (Visual Studio C++ 2017 Community), it entraps both SIMCONNECT_OPEN and SIMCONNECT_QUIT into WinForms private methods, even simple guess is a good starting point to create nice UI that can crosstalk with the sim via SimConnect.
Credits due also to Benjamin Erd that pointed me in the right direction, a good example of connections with fellow developers and helping each other, guess is the right way rather than insults.
/Mario
 
Back
Top