Old 26th June 2002, 11:45   #1
xincale
Junior Member
 
Join Date: Jun 2002
Posts: 3
Can someone help me? Please!!

I add a file(*.m3u) to WINAMP PLAYLIST with below code.
1¡¢Most of time,it work well when state of WINAMP be normal.but,the file dont be added to PlAYLIST sometimes
2¡¢the file alway dont be added to PlAYLIST when state of WINAMP be minimized.
Why? Can someone help me?
Thanks

Xincale 2002.06.26

Public Sub WinAMP_AddFileToPlayList(Filename As String)
'Adds a file to the playlist

'hWndWinamp is a property of this ClASS
If hWndWinamp = 0 Then 'can't find Winamp
Exit Sub
End If

Dim cds As COPYDATASTRUCT
cds.dwData = waAddFile
' = 100 (IPC_PLAYFILE)
cds.lpData = lstrcpy(Filename, Filename)
' Copies filename to itself. Nothing happens,
' but returns the address for the pointer to the string!
cds.cbData = Len(Filename) + 1
' Reserve space for filename plus trailing null char

RetVal = CopyDataSendMessage(hWndWinamp, WM_COPYDATA, 0&, cds)

End Sub
xincale is offline   Reply With Quote
Old 27th June 2002, 00:05   #2
Gourou
Senior Member
 
Gourou's Avatar
 
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
*works on it* but, I dunno, I cant recreate your problem, I have no problem adding to the playlist, whether winamp is minimized or not, and it always works
Gourou is offline   Reply With Quote
Old 27th June 2002, 03:56   #3
xincale
Junior Member
 
Join Date: Jun 2002
Posts: 3
Problem be solve

modify the code:
Change "cds.cbData = Len(Filename) + 1" to "cds.cbData = LenB(Filename) + 1"

Now,it work well.
Mey be,the reason is about coding of system, double byte?
xincale is offline   Reply With Quote
Old 27th June 2002, 04:46   #4
Gourou
Senior Member
 
Gourou's Avatar
 
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
could be that your file system is coming in as unicode, yeah
Gourou is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump