Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: EM_GETLINE with vector

Started 1 month, 2 weeks ago by MasterDucky
Hello! Im trying to use EM_GETLINE with vector<char> instead of a dynamic char array. Its working with some minor bugs: - if i type only one letter i get one garbage character - there are some garbage at the end of the lines sometimes Its maybe the vector functions that i dont use right. Any suggestions highly appreciated. Code: case GetText: {...
Site: CodeGuru Forums - A Developer.com Community for C++, C#, VB, Java and .NET Solutions  CodeGuru Forums - A Developer.com Community for C++, C#, VB, Java and .NET Solutions - site profile
Forum: C++ and WinAPI  C++ and WinAPI - forum profile
Total authors: 2 authors
Total thread posts: 3 posts
Thread activity: no new posts during last week
Domain info for: codeguru.com

Other posts in this thread:

Codeplug replied 1 month, 2 weeks ago
>> CopyMemory(&vLines[0], &iLength, sizeof(WORD)+1); You are copying one to many bytes. Also, you'll want to copy in the same value that was passed to resize() - since that's the size of the buffer. >> vLines.push_back( '\0' ); //do i need this? Not like that. EM_GETLINE returns the number of characters copied. Just use "vLines[num_copied] = 0". Your buffer will then be a null-...

MasterDucky replied 1 month, 2 weeks ago
Perfect! Thank you very much Codeplug!

 

Top contributing authors

Name
Posts
MasterDucky
2
user's latest post:
EM_GETLINE with vector
Published (2009-11-06 00:35:00)
Perfect! Thank you very much Codeplug!
Codeplug
1
user's latest post:
EM_GETLINE with vector
Published (2009-11-05 13:07:00)
&gt;&gt; CopyMemory(&amp;vLines[0], &amp;iLength, sizeof(WORD)+1); You are copying one to many bytes. Also, you'll want to copy in the same value that was passed to resize() - since that's the size of the buffer. &gt;&gt; vLines.push_back( '\0' ); //do i need this? Not like that. EM_GETLINE returns the number of characters copied. Just use &quot;vLines[num_copied] = 0&quot;. Your buffer will...

Related threads on "CodeGuru Forums - A Developer.com Community for C++, C#, VB, Java and .NET Solutions":

Related threads:

No related threads found!

Thread profile page for "EM_GETLINE with vector" on http://www.codeguru.com. This report page is a snippet summary view from a single thread "EM_GETLINE with vector", located on the Message Board at http://www.codeguru.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity