Results 1 to 7 of 7

Thread: need help using char* return from winamp API

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    New Zealand
    Posts
    5

    need help using char* return from winamp API

    ret = SendMessageLong(hWndWinamp, WM_USER, index, IPC_GETPLAYLISTFILE)

    where:

    WM_USER = &H400,
    index = index of the desired song in the current playlist,
    IPC_GETPLAYLISTFILE = 211.

    Equivalent C declaration is:

    char *name = SendMessage(hwnd_winamp, WM_USER, index, IPC_GETPLAYLISTFILE);

    Which returns a char* - how do I use this in VB?


  2. #2
    Megatron
    Guest
    I believe that translates to a String.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    New Zealand
    Posts
    5
    Thanks Megatron - that's what I thought too - but I don't seem to be getting the right info back.

    If I assign it straight to a string I get a whole lot of numbers - ie. temp = "412329"

    I must be using the API call incorrectly.

  4. #4
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    you could be getting the memory address for it, but that doesn't make since, since it would go out of scope as soon as the SendMessage call ended! I must be misthinking this
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    New Zealand
    Posts
    5

    Unhappy

    hmmmmm

    What does putting '&' at the end of a variable do?

    ie.

    text& = SendMessageLong(hWndWinamp, WM_USER, index, IPC_GETPLAYLISTFILE)



  6. #6
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    not the same thing as in C. it sets the data type to long
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  7. #7
    Megatron
    Guest
    Try playing around with pointers (StrPtr), and CopyMemory.

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