Skip to main content
gamedev.net
🔒 Locked

string manipulation

Started by AbsolutDew Apr 11, 2002 at 7:43 PM 0 replies 250+ views
Original Post
AbsolutDew
AbsolutDew
ok, im trying to write a real time logging program to work with instant messanger, and ive run into a problem. This is what I have so far...
  
	int iOldTextLength = 0;
	int iTextLength = 0;
	char szTextBuffer[10000];

	iTextLength = SendMessage( IMWatchList[0].GetIMRecvHwnd(), WM_GETTEXTLENGTH, 0, 0 );
	if( iTextLength > iOldTextLength )
	{
		// New message recieved

		int iTextDifference = iTextLength - iOldTextLength;

		SendMessage( IMWatchList[0].GetIMRecvHwnd(), WM_GETTEXT, (WPARAM)iTextLength, (LPARAM)szTextBuffer );
	}
	iOldTextLength = iTextLength;
  
There are two problems, first of all I don''t know how to get only ''iTextDifference'' characters from the END of szTextBuffer into a seperate string. And two, my entire method here is flawed, because i could easily overflow the text buffer, especially when you take into account the text retrieved with WM_GETTEXT is HTML, not plaintext. But i figure this might at least give you an idea of what im trying to do, and maybe someone could point me in the right direction.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.