Original Post
I researched into Quake II PAK files and I tried out some code, but I must have a memory leakage or something... something is not right. I keep getting that dialog box saying "This program has encountered a problem." Here's the code: typedef struct { char Signature[4]; int DirOffset; int DirLength; int NumFiles; } pakHeader; typedef struct { char FileName[56]; int FilePosition; int FileLength; } pakEntry; bool OpenPAK(HWND hWnd, char FileName[]) { // Open a PAK file FILE *file; pakHeader Header; pakEntry *Entry; int NumFiles; file = fopen(FileName, "rb"); fread(&Header, sizeof(Header), 1, file); if (strncmp(Header.Signature, "PACK", 4)) fclose(file); fread(&Header.DirOffset, sizeof(int), 1, file); fread(&Header.DirLength, sizeof(int), 1, file); NumFiles = Header.DirLength / sizeof(Header); Entry = new pakEntry[NumFiles]; fseek(file, Header.DirOffset, SEEK_SET); fread(Entry, sizeof(pakEntry), NumFiles, file); for (int i = 0; i < NumFiles; i++) SendMessage(hListView, LB_ADDSTRING, 0, (LPARAM) Entry.FileName); return true; } Basically, I want this program to load a PAK file, and display the contents in a listbox that I have placed on the form. I'm guessing the problem lies with the Entry pointer and that the FOR loop and SendMessage function are having problems. Please help fix this problem.