Windows::Forms::TextRenderer::DrawText(gT, numTo100, sfo, Rectangle(2, 2, 12, 12), SystemColors::ControlText);
is giving the error
1>error C2665: ‘System::Windows::Forms::TextRenderer::DrawText’ : none of the 8 overloads could convert all the argument types
1> could be ‘void System::Windows::Forms::TextRenderer::DrawText(System::Drawing::IDeviceContext ^,System::String ^,System::Drawing::Font ^,System::Drawing::Point,System::Drawing::Color)’
1>or ‘void System::Windows::Forms::TextRenderer::DrawText(System::Drawing::IDeviceContext ^,System::String ^,System::Drawing::Font ^,System::Drawing::Rectangle,System::Drawing::Color)’
If I lose the line I get no errors. I’ve tried it the other way with Point and it was working fine in my other project. Any ideas would be appreciated, thanks.
EDIT
Here are the pertinent preceeding lines, FWIW..
System::Drawing::Font sfo(FontFamily::GenericSansSerif, 8.0F, FontStyle::Bold);
You’ve created your
Fontobject using stack semantics, so in order to pass it to a function wanting a tracking handle (Font^), you need to use unaryoperator%, much as you would use unaryoperator&to get an object pointer from an object value in C++: