Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. use of any in vb.net

use of any in vb.net

Scheduled Pinned Locked Moved Visual Basic
helpcsharpdotnetjson
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sundar_mca
    wrote on last edited by
    #1

    I am migrating the vb project from vb6.0 to vb.net framework.when i am trying to migrate the api function its showing the error in any the below function. Declare Function CopyString Lib "kernel32" Alias "lstrcpy" (hdest As Any, hsource As Any) As Long in this function vb.net dosent support any as keyword.give me some solution for solving the above problem.. pls reply me as soon as possible:((

    D D 2 Replies Last reply
    0
    • S sundar_mca

      I am migrating the vb project from vb6.0 to vb.net framework.when i am trying to migrate the api function its showing the error in any the below function. Declare Function CopyString Lib "kernel32" Alias "lstrcpy" (hdest As Any, hsource As Any) As Long in this function vb.net dosent support any as keyword.give me some solution for solving the above problem.. pls reply me as soon as possible:((

      D Offline
      D Offline
      Duncan Edwards Jones
      wrote on last edited by
      #2

      "As Any" was a bad idea in VB6 and there is no need whatsopever for it in VB.Net - instead declare an overloaded version of the function for each of the data types you are going to pass to the API.

      '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

      1 Reply Last reply
      0
      • S sundar_mca

        I am migrating the vb project from vb6.0 to vb.net framework.when i am trying to migrate the api function its showing the error in any the below function. Declare Function CopyString Lib "kernel32" Alias "lstrcpy" (hdest As Any, hsource As Any) As Long in this function vb.net dosent support any as keyword.give me some solution for solving the above problem.. pls reply me as soon as possible:((

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        On top of what Duncan posted, CopyString has some SERIOUS limitations on it's use in the .NET Framework. Since an object can be moved at any time, CopyString can be passed invalid addresses unless the objects invloved are pinned in place. What does this function do that you require the use of CopyString??

        Dave Kreskowiak Microsoft MVP - Visual Basic

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups