The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Ash_ on January 08, 2005, 08:59:11 AM

Title: Parsing Text bug
Post by: Ash_ on January 08, 2005, 08:59:11 AM
ok i posted a thread recently about geting the text from winamp (thanks anon  :U)
now i've created a procedure that parses the text into dword's but it doesent work properly.
it's supposed to get the Title, Artist, SongIndex and the whole text and put them in variables.
but for some songs it only gets Title and Artist.
others it will only get Title Artist and SongIndex.
also if i play one song. click the parse text button, change song and click the button again nothing happens?
im only new to Assembly so it might probly something easy. thanks in advance anyway.

[attachment deleted by admin]
Title: Re: Parsing Text bug
Post by: anon on January 08, 2005, 03:44:32 PM
I don't have winamp so I could not use your program, but I do
see a few problems. First you are using an uninitialized buffer to
build your string in. This is not bad, but the first thing you do is
call lstrlen on this buffer. This is bad. You have no idea what may
be in the buffer and lstrlen just looks for the first 0 (zero) and
reports that length, not the actual length of the buffer. Next,
lstrlen reports the length of the string WITHOUT including the
terminating zero. Most Windows string functions need the length
including the zero. Hope this helpsĀ  :UĀ 
Title: Re: Parsing Text bug
Post by: Ash_ on January 10, 2005, 06:44:30 AM
cheers anon works good now.