Board index » cppbuilder » TCanvas.CreateHandle
KonZa
![]() CBuilder Developer |
TCanvas.CreateHandle2003-12-15 09:54:33 AM cppbuilder66 hi there how come TCanvas.CreateHandle is a empty procedure? Anyway... which is the EASY way to TextExtent a string without have any canvas. I'tried TCanvas *c = new TCanvas(); c->Font->Name = "Tahoma"; c->Font->Size = 10; /* Raise exceptio here! */ /* since VCL graphics.pas source code @ line .... well I forget (method TCanvas.CreateHandle()) is an empty procedure so FHandle property still be the same as the constructed.... say Nil. */ c->TextWidth( AnsiString( "my_string" ) ); delete c; So I've try to use CreateCompatibleDC based on some hWnd... but I don't know if its that the correct way OR EVEN LOOSSING MEMORY. thanks in advnace. |