|
|
#1 |
|
Junior Member
Join Date: Apr 2002
Posts: 27
|
More FileName Crud.
Hello. I've been following the FileName discussion messages, and am still at a bit of a loss. I can get everything alright up until the pointer, but when I try to do a copy I just get an access violation.
I'm currently using MSVC++ 6. Here's the code: int index = SendMessage(hwndWinamp, WM_USER, 0, 125); //returns the playlist position long filename=SendMessage(hwndWinamp, WM_USER, index, 211); CHAR file[255] ; lstrcpy(file,filename); If anyone can tell me how I've horribily screwed up I'd be grateful. ![]() -Rz |
|
|
|
|
|
#2 |
|
ist death
Join Date: May 2000
Posts: 3,704
|
are you doing that in a plugin or in an external exe ?
|
|
|
|
|
|
#3 |
|
French Canadian
(Alumni) |
I think this is what you want.
code: Aus -- NoisePort.Org, chronicles of the french canadian alien (Temporarly down during the move). |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Apr 2002
Posts: 27
|
Well, that had a slighty different effect:
WINAMP caused an invalid page fault in module WINAMP.EXE at 017f:0041de76. and then I get the standard Access Violation from the program. Any ideas? --And it is an external file, yes. |
|
|
|
|
|
#5 |
|
French Canadian
(Alumni) |
you need to make the buffer you pass large enough to old the song, might i suggest something like... 512bytes or 1024.
Here's the same function as before but I modified it to match exactly what you need. Infact, it's not even a function anymore. ![]() code: Aus -- NoisePort.Org, chronicles of the french canadian alien (Temporarly down during the move). |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Apr 2002
Posts: 27
|
Nope, still crashing with an access violation.
It actually looks like p itself is causing the crash, not the strcpy. If I try to dump p anywhere else, I get the same crash. I also tried allocating memory for the pointer (p=new char[1024];) but it seems to have no effect. Last edited by Rz_Ten1; 11th April 2002 at 21:23. |
|
|
|
|
|
#7 |
|
ist death
Join Date: May 2000
Posts: 3,704
|
you can't get filenames, etc from an external exe (RTFM) because returned pointers aren't valid (and will never be) in your process space. if you really need them, write a plugin which gets filenames and comunicates with your program using WM_COPYDATA, DDE or something else.
|
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Apr 2002
Posts: 27
|
I see. Is there any way to do it outside of a plugin other then the list dump method? I would rather not have it be plugin based.
|
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Apr 2002
Posts: 27
|
While that would and does work, I'm trying to get the filename, not the title. I'd like to do my own ID3 processing.
|
|
|
|
|
|
#11 |
|
ist death
Join Date: May 2000
Posts: 3,704
|
i think there is some message that saves current playlist to winamp.m3u; you could use it, then read winamp.m3u
|
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Apr 2002
Posts: 27
|
Yeah, I've seen that... I was just hoping there was a faster way. Thanks for the help everyone.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|