Sign in to follow this  
MKaprocki

String Mapping in GDI+

Recommended Posts

Hi does anyone know how to map to a WCHAR string for use in gdi+? sprintf etc aren't working for some reason and im not too keen about writing my own string mapping routines and classes. Is there some sort of easy conversion?-Jon

Share this post


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

I keep getting an error with this code: //Altitude StringWCHAR altitude[6] = L"50000";wsprintf(&altitude, "%5f", hgs_alt.var_value.n);because of the first parameter in wsprintfand I get an error with the draw string with the first parameter in this code: wsprintf(altitude, "%5f", hgs_alt.var_value.n); FontFamily fontFamily(L"Arial"); Font font(&fontFamily, 15, FontStyleBold, UnitPoint); RectF altrec(899.0f, 271.0f, 70.0f, 23.0f); gdip_drawer.DrawString(&altitude, -1, &font, altrec, NULL, &solidBrush);

Share this post


Link to post
Share on other sites

Sorry about that, my mistake....swprintf is what you want, not wsprintf. D'oh!WCHAR value_buffer<5>;swprintf(value_buffer, L"%f", .5);

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