Click to See Complete Forum and Search --> : need help using char* return from winamp API
nandor
May 31st, 2001, 04:20 AM
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: :o
char *name = SendMessage(hwnd_winamp, WM_USER, index, IPC_GETPLAYLISTFILE);
Which returns a char* - how do I use this in VB?
:confused: :confused: :confused:
Megatron
May 31st, 2001, 03:34 PM
I believe that translates to a String.
nandor
May 31st, 2001, 04:15 PM
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.:confused:
gwdash
May 31st, 2001, 06:34 PM
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
nandor
May 31st, 2001, 11:27 PM
hmmmmm:(
What does putting '&' at the end of a variable do?
ie.
text& = SendMessageLong(hWndWinamp, WM_USER, index, IPC_GETPLAYLISTFILE)
:confused: :confused: :confused:
gwdash
Jun 1st, 2001, 07:00 AM
not the same thing as in C. it sets the data type to long
Megatron
Jun 1st, 2001, 02:52 PM
Try playing around with pointers (StrPtr), and CopyMemory.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.