private void ShowContants(string filename) { if (filename.EndsWith(".max", StringComparison.InvariantCultureIgnoreCase)) { mInternalFilesListBox.Items.Clear(); int result = LoadARMaxFile(filename); int numFiles = ARMaxNativeMethods.NumberOfFiles(); StringBuilder buff = new StringBuilder(256); int fileSize = -1; // show the files in the list box for (int i = 1; i < numFiles + 1; i++) // there is no '0'th file { try { result = ARMaxNativeMethods.FileDetails(i, buff, 256, ref fileSize); if (result == 0) { mInternalFilesListBox.Items.Add(buff.ToString()); // add to the list box items } else { Console.Error.WriteLine("Error Code = {0}", result); } } catch (Exception exc) { Console.Error.WriteLine("Error calling 'ARMaxNativeMethods.GetRootDir()' LastError:{0}\n{1}", System.Runtime.InteropServices.Marshal.GetLastWin32Error() , exc.Message ); } buff.Length = 0; // clear out the chars in buff } ARMaxNativeMethods.FreeMaxSave(); mExtractButton.Enabled = true; } else { MessageBox.Show("This is not a a .max file: " + filename); } }