Results 1 to 9 of 9
  1. #1
    tehjimpie's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    5
    Reputation
    10
    Thanks
    0

    [HELP] vb 6.0 > vb.NET

    hey

    it seems visual basic 2008 do not support this anymore:

    Code:
    Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpKeyname As Any, ByVal lpString As String, ByVal lpfilename As String) As Long
    Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpKeyname As Any, ByVal lpdefault As String, ByVal lpreturnedstring As String, ByVal nsize As Long, ByVal lpfilename As String) As Long
    do anybody know the code from this in visual basic 2008?

    thanks!

  2. #2
    Born2Amuse's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Sydney, Australia
    Posts
    36
    Reputation
    10
    Thanks
    9
    My Mood
    Innocent
    Windows API calls are supported in VB.NET but the keyword Any is no longer supported. You can replace Any with String since you are reading and writing to the INI file.

  3. #3
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Quote Originally Posted by Born2Amuse View Post
    Windows API calls are supported in VB.NET but the keyword Any is no longer supported. You can replace Any with String since you are reading and writing to the INI file.
    Good point, but you know what would really help him understand, why don't you go ahead and explain to him the differences between each, and also the reason for the change.

    Also, explain to him why string will work in this situation, and not one of the other options that could be available, he needs to learn, and I think you can show him how to.

    Giving the answer is never enough
    Last edited by NextGen1; 01-23-2011 at 04:15 PM.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  4. #4
    Born2Amuse's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Sydney, Australia
    Posts
    36
    Reputation
    10
    Thanks
    9
    My Mood
    Innocent
    The keyword Any was used in VB6 the same way Object type is used in VB.NET. It implicitly converts the entered type to required type by the API call. The reason this keyword is not supported is because of the many enhancements of type conversion in .NET and safer execution. VB.NET wants you to take care of it. Object type can mostly be used in place of Any. This will take care of most of the API's. But the best method is always to use the desired data type.

  5. #5
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Quote Originally Posted by NextGen1 View Post


    Good point, but you know what would really help him understand, why don't you go ahead and explain to him the differences between each, and also the reason for the change.

    Also, explain to him why string will work in this situation, and not one of the other options that could be available, he needs to learn, and I think you can show him how to.

    Giving the answer is never enough
    Lol, NG don't you know that ? You should've told him. And 100 % agree with new guy. Looks like we have new pro in town ;]

  6. #6
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    @ hassan, of course I do, Just wanted the new guy to get use to it, these things help the ppl who ask questions, consider it his "on site training"


     


     


     



    The Most complete application MPGH will ever offer - 68%




  7. The Following User Says Thank You to NextGen1 For This Useful Post:

    Hassan (01-23-2011)

  8. #7
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Finally someone that isn't just going to post a couple of webbrowsers

    Welcome Born.



  9. #8
    Born2Amuse's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Sydney, Australia
    Posts
    36
    Reputation
    10
    Thanks
    9
    My Mood
    Innocent
    Thank you Blubb1337. I laughed at your avatar (:

  10. #9
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    New blood. It's been a long time coming.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)