Hello ~
I'm writing a GUI program which reads and edits ID3 tag data from MP3s. However, I am having a little problem extracting some of the data. I am sure that this is something simple that I have overlooked (it always is :P)...
Code:
//Initiate ID3 reading functionality
class ID3struct
{
public:
char TID[3];
char title[30];
char artist[30];
char album[30];
char year[4];
char comment[30];
BYTE genre;
}
ID3Data;
{
HANDLE hFile;
DWORD read;
char ID3[128];
hFile = CreateFile("bond.mp3", // file to read
GENERIC_READ, // open for reading
0, // do not share
NULL,// default security
OPEN_EXISTING, // open file if exists
FILE_ATTRIBUTE_NORMAL, // normal file
NULL); // no attr. template
SetFilePointer(hFile, -128, NULL, FILE_END);
ReadFile(hFile, ID3, 128, &read, NULL);
CloseHandle(hFile);
memcpy(&ID3Data, ID3, 128);
MessageBox(GetActiveWindow(),ID3.title, "Elixir ID3 Editor", MB_OK | MB_ICONINFORMATION);
}
This is the problematic extract from my WM_CREATE event. The error I am getting is :
error: request for member 'title' in 'ID3' , which is of non-class type 'char [128]'
I haven't a clue as to what is going on. I am using the compiler that comes with Dev-C++ (so essentially Dev-C++). If anyone could help, I would be extremely gratefull.
Thanks;
Christopher Howarth