need help with accessing C:Vars

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Post Reply
vamshi.chittaluri
Posts: 7
Joined: Sat Aug 22, 2020 9:04 pm

need help with accessing C:Vars

Post by vamshi.chittaluri »

Hello All,

First of all i'd like to thank you all for taking your time to look at this post. Any help is highly appreciated.

I am using VRS tackpack and i need some custom vars, C:Vars to be retrieved into my simconnect exe app. How can i achieve this? In their SDK they point to the following, i am new to c++, have been able to play around with SimConnect quite a bit, however i need to get those C:Vars into SimConnect. Is there any way i can make this happen? I've seen mentions of looking at the mixedmode example in the sdk (cabin comfort). I've looked into it and tried to understand, however, i have not been able to understand the code properly. Is there any described example or can anyone point me in a direction that would allow me to pull CVars from VRS TacPack?

Also ran into this: http://www.prepar3d.com/forum/viewtopic ... 1&t=135650

In this case, the OP is working with the data harvester example i think to implement this. is mixing the PDK and C Gauges going to work as well? or do i have to build on top of a C Gauges example?

This is code i found on the VRS TacPack SDK...

Code: Select all

#include "gauges.h"

//NOTE: very simplified code will all error checking omitted.
//This is just to give you an idea of what's involved, and not intended to be used directly.

IPanelCCallback *pPCC_TPUtil = panel_get_registered_c_callback("VRSTP_Util");
IAircraftCCallback *pACC_TPUtil = pPCC_TPUtil->CreateAircraftCCallback(0);
IGaugeCCallback *pGCC_TPUtil = pACC_TPUtil->CreateGaugeCCallback();

//First we need the property ID of the CVar we're going to interact with
//NOTE: CVar IDs only change at certain definable points (ie, aircraft reloads, etc)
//      so you do NOT have to convert from string to ID every frame
SINT32 ID = 0;
pPCC_TPUtil->ConvertStringToProperty("MoaName", &ID);

//Writing string data to a CVar ala: 'TestName' (>C:VRSTP_Util:MoaName, string)
char szVal[] = "TestName";
pGCC_TPUtil->SetPropertyValue(ID, szVal);

//Reading string data from a CVar ala: (C:VRSTP_Util:MoaName, string)
PCSTRINGZ pS = NULL;
pGCC_TPUtil->GetPropertyValue(ID, &pS);
printf("MoaName: %s\n", pS);  //Should print "MoaName: TestName"
.......
https://forums.vrsimulations.com/support/index.php/TacPack_SDK
Please suggest.


Once again, thank you for all the help.
Post Reply