I need to split a paragraph into lines based on a given width in pixels. The idea being that as a user resizes the window, they can see more or less of the paragraph as the window is made wider or narrower in the same was as notepad would with word wrap on. Is there anything in the Windows API that has already solved this problem?
Thanks for the suggestion but I'm looking to determine the starting offset of each line within the paragraph. I could manually parse the string and use GetTextExtentPoint32() to work it out myself but I imagine that will be slow and I thought maybe an API might already exist as something like an edit control will already be doing something similar.
My app is C++ based (no .net) and I need to know where on earth my app is started. This is in order to access a website (e.g. www.xyz.cn/info for china; www.xyz.com/info for the rest) with the correct region.
I've tried with ILocation Com interface but it tells me that there are 'no devices detected'.
Below code does some memory corruption due to which access violation happens at sub subsequent steps
If I remove this block of code every thing is working fine. Unable to figure out the issue in the below code. Please help
You are unlikely to get a valid answer doing it like that. You should use something like sprintf to convert the double value to a string and set the actual number of decimal places that you want in the format string.