Bug: Crash in panels.dll after stack overflow and out of memory.

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.
Locked
minime
Posts: 1198
Joined: Mon Jun 10, 2013 4:33 pm

Post by minime »

I have the following in my panel.cfg:



Code:
[Window01]
visible=1
ident=TLP HMD
Background_color=0,0,0
alpha_blend=0.6
position=0
window_size= 1.000, 1.000
size_mm=1440,900
gauge00=THREATGauges!HMD,0,0



I was having problems centering text in the middle of the screen and I found out that the following code:



Code:
std::auto_ptr<Gdiplus::Graphics> gdc (new Graphics(hdc));
gdc->GetVisibleClipBounds(&VisBounds);



produces this:



VisBounds.Width = 1920;

VisBounds.Height = 1693;



Now I have no idea why the height value of the HDC given to my gauge DLL is 1693px, and with that invalid height I can not center the text in the vertical center of the screen because it only actually renders the 1080px my monitor supports. This is NOT in fullscreen btw.



And then this:



Code:
[Window01]
visible=1
ident=TLP HMD
Background_color=0,0,0
alpha_blend=0.6
position=0
size_mm=1280,720
gauge00=THREATGauges!HMD,0,0, 1280,720



Produces a HDC with 2400x992 pixels.



Playing around with it I changed the panel.cfg to this:



Code:
[Window01]
visible=1
ident=TLP HMD
Background_color=0,0,0
alpha_blend=0.6
position=0
window_size= 1.000, 1.000
gauge00=THREATGauges!HMD,0,0



As soon as I actually display the gauge, I get this before my gauge is even called:



First-chance exception at 0x54043F87 (panels.dll) in Prepar3D.exe: 0xC00000FD: Stack overflow (parameters: 0x00000000, 0x00092000).



panels.dll!54043f87() Unknown

[Frames below may be incorrect and/or missing, no symbols loaded for panels.dll]

panels.dll!53ff13f8() Unknown



And:



"Your computer has run out of available memory. Please restart Prepar3d[...]"



I think I may be on to something weird here.



Can you please explain why the height is reported at being 1693? And fix the crash if possible, that would be nice. :)



Thx,



Minime
User avatar
WarpD
Posts: 1469
Joined: Mon Feb 14, 2011 5:29 am

Post by WarpD »

What is the declared default with for your gauge?
Ed Wilson
Senior Developer
Mindstar Aviation
Locked