Sign in to follow this  
bcs112

Gauge crashes FS2002 upon resize - ntdll.dll

Recommended Posts

Hi,I'm still trying to get the details of my first GDI+ vector gauge to work.I have 2 main problems at this time:- if I resize the FS2002 window while my vector gauge is loaded, FS crashes with an ntdll.dll error. Apparently the ntdll.dll file is used for almost everything in WinXP, but maybe somebody else also encountered this problem and can point me in the right direction for a solution ?- if I open FS2002 non-maximizes, then the drawings in my gauge are not scaled down with the rest of the gauge. I am using absolute sizes and positions at this time in my gauge and I probably need to use relative sizing, so how can I obtain the actual width and height of my gauge ?Thx for the help,Bj

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hans,Thx for the quick reply. Hmm, wasn't aware I actually needed to clean up pens... will have a look at that !You wouldn't happen to know how to obtain the current gauge size would you, or is there a property like: pelement->width or something like that ?Bj

Share this post


Link to post
Share on other sites

It's pelement->image_data.final->dim.x (and .y)It's important that you do the cleanup. You can't use Managed C++ for gauges (OK, might work, but will be awfully slow), so you need to clean up everything.

Share this post


Link to post
Share on other sites

Hans,OK I've more or less changed all my declarations from this:Font myFont(L"Arial", 8);Pen whitePen(Color(255, 255, 255, 255), 1);to Font* myFont = new Font(L"Arial", 8);Pen* whitePen = new Pen(Color(255, 255, 255, 255), 1);I also added:delete myFont;For each of the object created at the end of PANEL_SERVICE_PRE_DRAW event.I said more or less because I had problems with the RectF class, when I do this:RectF* layoutRect1 = new RectF(185.0f, 50.0f, 35.0f, 15.0f);graphics->DrawString(string, 5, myFont, layoutRect1, format, whiteBrush);I get this compiler error:"error C2664: 'enum Gdiplus::Status __thiscall Gdiplus::Graphics:: DrawString(const unsigned short *,int,const class Gdiplus::Font *,const class Gdiplus::RectF &,const class Gdiplus::StringFormat *,const class Gdiplus::Brush *)' : cannot convert parameter 4 from 'class Gdiplus::RectF *' to 'const class Gdiplus::RectF &' Reason: cannot convert from 'class Gdiplus::RectF *' to 'const class Gdiplus::RectF' No constructor could take the source type, or constructor overload resolution was ambiguous"And indeed FS still crashes upon resize... sighBj

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this