Help converting VB 6.0 to VB 2005

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bl00dFox
    New Member
    • Mar 2007
    • 12

    Help converting VB 6.0 to VB 2005

    Hi guys

    I converted a VB6 project to a VB 2005 project. All went well, but there is an error in this code:

    Code:
    Private Declare Function SendMessage Lib "user32.dll"  Alias "SendMessageA"(ByVal hwnd As Integer, ByVal Msg As Integer, ByRef wParam As Any, ByRef lParam As Any) As Integer
    VS2005 tells me:

    Error 1 'As Any' is not supported in 'Declare' statements.

    Can someone help me fix this? Thanks
  • ansumansahu
    New Member
    • Mar 2007
    • 149

    #2
    Originally posted by Bl00dFox
    Hi guys

    I converted a VB6 project to a VB 2005 project. All went well, but there is an error in this code:

    Code:
    Private Declare Function SendMessage Lib "user32.dll"  Alias "SendMessageA"(ByVal hwnd As Integer, ByVal Msg As Integer, ByRef wParam As Any, ByRef lParam As Any) As Integer
    VS2005 tells me:

    Error 1 'As Any' is not supported in 'Declare' statements.

    Can someone help me fix this? Thanks

    Hi ,

    This type of declaration is not supported in Visual Basic 2005. In VB 6.0 variables of type As Any were often used to pass a variable that was either a string or Null; you will have to replace this Visual Basic 6.0 usage by declaring two forms of the API, one with longs, one with strings.

    thanks
    ansuman sahu

    Comment

    Working...