hi, i've some zero terminated strings that i want to put on my window with TextOut. but when i run the program on windows nt there is a square directly after the string. i thought that it has something to do with that zero at the end of the string. is that right? what can i do against that? is the identifier of the end of strings something else than in windows 9x? tnx.
Posted on 2001-03-20 03:10:00 by [SaFc0n]
TextOut requires you to give it a length of the string, so if you have:- MyString db 'abcd',0 then the length is 4, if you specify the length as 5 you will see the little square. Use lstrlen to find the length.... If you want an example I'll post it here. umbongo
Posted on 2001-03-20 03:43:00 by umbongo
no thank you. i got it. but, does sizeof string doesn't return the length of the string correctly?
Posted on 2001-03-20 05:48:00 by [SaFc0n]
sizeof will give you the total size, including the null at the end. use lstrlen :) Umbongo
Posted on 2001-03-20 06:19:00 by umbongo