Jump to content
Sign in to follow this  
MKaprocki

String Mapping in GDI+

Recommended Posts

Guest Jon_Gibbs

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
Guest Jon_Gibbs

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...