Thread: A little problem with a class

  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    32

    A little problem with a class

    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

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> ID3.title
    Did you mean ID3Data.title?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Mesh Class Design problem
    By sarah22 in forum Game Programming
    Replies: 2
    Last Post: 05-20-2009, 04:52 AM
  2. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  3. Class design problem
    By h3ro in forum C++ Programming
    Replies: 10
    Last Post: 12-19-2008, 09:10 AM
  4. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 02:33 PM
  5. Replies: 3
    Last Post: 12-03-2001, 01:45 PM