Results 1 to 2 of 2

Thread: Help converting vb 2008 to vb6

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Help converting vb 2008 to vb6

    Hi all .could any one help me convert the following code from vb 2008 to vb6 ? All it does reads text line from a chat room application. Looking forward for replies.Thanks


    3 Code:
    1. Declare Function SendMessageString Lib "USER32" _
    2. Alias "SendMessageA" (ByVal hwnd As Integer, _
    3. ByVal wMsg As Integer, ByVal wParam As Integer, _
    4. ByVal lParam As StringBuilder) As Integer
    5.  
    6. Public Function GetLastLineTextChat(ByVal hwnd As Integer) As String
    7.     Dim iLastLine As Integer
    8.     Dim strBuffer As New StringBuilder(255)
    9.     'Get Line count
    10.     iLastLine = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0)
    11.     'get line text
    12.     Call SendMessageString(hwnd, EM_GETLINE, iLastLine - 2, strBuffer)
    13.     Return strBuffer.ToString
    14. End Function
    15.  
    16.  
    17. Private Sub Command1_Click()
    18. Dim sChatText as String = GetLastLineTextChat(ReadTxtHnd)
    19. End Sub

  2. #2
    Addicted Member
    Join Date
    Jul 2006
    Location
    Adelaide, Australia
    Posts
    204

    Re: Help converting vb 2008 to vb6

    that should work in VB6. The one thing you will need to do is find the constants. Also, if you put this in a form you will need to change the line:

    Declare Function SendMessage.....
    to
    Private Declare Function SendMessage.....

    to find the constants I generarally google: VB6 Const EM_GETLINECOUNT =
    and see what it returns. Most constants are declared in this format &H2 which is just hex for 2.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width