Reading and writing Lvar from C++

#41
Go to my website and download
p3d_xml_vars_x64
It is a gauge that you can to the panel of a test aircraft. It will allow you to scroll through all lvars active in the session, giving you the ID, the name and the current value.
I just downloaded your p3d_xml_vars_x64 but can't get it to work. I first put the p3d_xml_vars_x64.dll in the P3DV4 root folder and added a popup window in the panel.cfg file per the text file included in the download. See below:

[Window14]
Background_color=2,2,2
size_mm=354,364
window_size_ratio=1.000
position=0
visible=1
ident=10035
window_size= 0.273, 0.352
window_pos= 0.000, 0.050
zorder=0

gauge00=xml_vars!xml_vars, 2,2,350

All I got was the black background with no Lvariable data. I then moved the dll file to the gauges folder and changed the gauge info to
gauge00=p3d_xml_vars_x64, 2,2,350 with the same result. Can you or anyone provide me any insight how to gets this gauge to display the data. It sounds like an incredible tool.

Bill
 
#43
I have the dd in the gauges folder but still no luck displaying Lvar data. Still only the black background.

I was told to enter the below into the dll.xml file:

<Launch.Addon>
<Name>XMLVars</Name>
<Disabled>False</Disabled>
<ManualLoad>False</ManualLoad>
<Path>Gauges\p3d_xml_vars_x64.dll</Path>
<DllStartName>module_init</DllStartName>
<DllStopName>module_deinit</DllStopName>
</Launch.Addon>

No luck there either. Any ideas what I am doing wrong?

Bill
 

ddawson

Resource contributor
#44
You don't need an entry in dll.xml for a gauge.
Did you add Window14 to the list of windows at the top of panel.cfg?
Make sure you change the entry for the gauge back to:

gauge00=xml_vars!xml_vars, 2,2,350

Doug
 
#45
Hi,
I am in a similar problem as written by roarkr in the first message of this thread.
My requirements is to have an external c++ exe to query for value of a particular LVAR(s) (by name) and the DLL module needs to respond with the current value of that LVAR(s).
I tried loading lvar_interface.dll (re-built as x64 for P3Dv4) through DLL.xml. Seems to have loaded fine (no errors in Content Error Log), but when I try to query for a LVAR value from a C++ exe by the function call
double Gbox = GetLVarByName("L:Gbox")
I am getting a memory access voilation exception.

I am able to successfully add the p3d_xml_vars_x64.dll gauge and see all the LVARs listed, but could get the values outside P3D to a C++ application.

A loadable LVAR bridging DLL module (similar to lvar_interface.dll) that can respond to an external C++ application with a queried LVAR name is what I need.
Any help from anyone who already tried something like this would be of great help.
 
#46
Doug,

Still not getting Lvar data to display just the black popup box.

I have removed the code from dll.xml file.

Created a folder xml_var in the gauges folder and put the p3d_xml_vars_x64 into it.

I put the below popup folder in the panel.cfg file and an enter Window14 =xml_vars in the top list of the panel.cfg file .

[Window14]
Background_color=2,2,2
size_mm=354,364
window_size_ratio=1.000
position=0
visible=1
ident=10035
window_size= 0.273, 0.352
window_pos= 0.000, 0.050
zorder=0

gauge00=xml_vars!xml_vars, 2,2,350

This only gave the same black background popup.

I then changed the gauge00 entry from gauge00=xml_vars!xml_vars, 2,2,350 to gauge00=xml_vars!p3d_xml_vars_x64, 2,2,350 to match the file I put in the gauges folder and this did not work either.

This is for P3DV4 so I think I need the 64 bit DLL to make this work.

Do you see anything I missed?

Thanks,

Bill
 
Top