- This topic has 13 replies, 2 voices, and was last updated 9 years ago by pharaon.
-
AuthorPosts
-
July 31, 2015 at 10:44 am #190537pharaonMember
Warning: A StringBuilder buffer has been overflowed by unmanaged code. The process may become unstable. Insufficient capacity allocated to the StringBuilder before marshaling it.
i get this when i get last line in chat room
any suggestion to fix
August 1, 2015 at 9:14 am #190550pharaonMemberthis is the code im using
Dim iLineIndex As Integer = SendMessage(hwnd, EM_LINEINDEX, ilastLine, 0) Dim iLineLength As Integer = SendMessage(hwnd, EM_LINELENGTH, iLineIndex, 0) if iLineLength = 0 return Nothing ' or return "" Dim sb As StringBuilder = New StringBuilder(iLineLength) sb.Append(ChrW(iLineLength)) sb.Length = iLineLength SendMessage(hwnd, EM_GETLINE, ilastLine, sb)
August 1, 2015 at 6:43 pm #190549ChikeMemberTry
Dim sb As StringBuilder = New StringBuilder(iLineLength+1) sb.Append(ChrW(iLineLength+1))
August 4, 2015 at 9:51 pm #190548pharaonMemberstill give me the same error
August 5, 2015 at 6:19 am #190547ChikeMemberPost send message declarations
August 6, 2015 at 12:16 pm #190546pharaonMemberDeclare Unicode Function SendMessage Lib "USER32" Alias "SendMessageW" (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As StringBuilder) As Integer Declare Auto Function SendMessage Lib "USER32" (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
August 7, 2015 at 2:36 am #190545ChikeMemberCode should work, use debugger or post code example project that don’t work here
August 7, 2015 at 1:44 pm #190544pharaonMemberit work but some times i give me this message A StringBuilder buffer has been overflowed by unmanaged code
August 7, 2015 at 10:31 pm #190543ChikeMemberI can’t debug for you, catch exception and make breakpoint there and see when it happens.
August 8, 2015 at 5:40 pm #190542pharaonMemberthat is the exception i get
Warning: A StringBuilder buffer has been overflowed by unmanaged code. The process may become unstable. Insufficient capacity allocated to the StringBuilder before marshaling it.
August 9, 2015 at 6:52 am #190541ChikeMemberYes catch it and check all relevant parameters in code.
Try SendMessage(hwnd, EM_GETLINE, ilastLine, sb) Catch ex As Exception MsgBox("SendMessage failed " & ex.Message) End Try
Set breakpoint at MsgBox
August 14, 2015 at 3:11 pm #190540pharaonMemberi did but couldn’t find any thing
August 15, 2015 at 6:55 am #190539ChikeMemberWhat all parameters ok and it fail?
August 15, 2015 at 11:38 pm #190538pharaonMemberyes
-
AuthorPosts
Related
- You must be logged in to reply to this topic.