Hello, I'm trying to write a .x file parser, however, the call to CreateEnumObject fails. When I try to parse tiger.x(31kb) from DirectX SDK, the function works fine, however, when I use tiny.x(1500kb) the function returns error(D3DXFERR_PARSEERROR). I also receive this error from RegisterTemplates...I have done much research to no avail...here is my code:

Code:
BOOL CXParser::Parse(char *filename, void** data)
{
	LPD3DXFILE				pDXFile = NULL;
	LPD3DXFILEENUMOBJECT	pEnum = NULL;
	LPD3DXFILEDATA			pDataObj = NULL;
	SIZE_T					nChildren = NULL;
	DWORD Depth = 0;	

	if(FAILED(D3DXFileCreate(&pDXFile)))
	{
		MessageBox(NULL, L"Could not Create DX File Interface Object", L"ERROR", MB_OK);
		return false;
	}
	hr = pDXFile->RegisterTemplates((LPVOID)XSKINEXP_TEMPLATES, sizeof(XSKINEXP_TEMPLATES)-1);
	if(FAILED(hr)){
		if(hr == D3DXFERR_PARSEERROR)
			MessageBox(NULL, L"Template Registration Failed (Enumeration Object Failure)", L"ERROR", MB_OK);
	}
	hr = pDXFile->CreateEnumObject(filename, DXFILELOAD_FROMFILE, &pEnum);
	if(FAILED(hr))
	{
		if(hr == D3DXFERR_PARSEERROR)
			MessageBox(NULL, L"Parse Error (Enumeration Object Failure)", L"ERROR", MB_OK);
		if(hr == D3DXFERR_FILENOTFOUND)
			MessageBox(NULL, L"File Not Found (Enumeration Object Failure)", L"ERROR", MB_OK);
		if(hr != D3DXFERR_PARSEERROR && hr != D3DXFERR_BADVALUE)
			MessageBox(NULL, L"Enumeration Object Failure", L"ERROR", MB_OK);
		pDXFile->Release();
		return false;
	}
	if(FAILED(pEnum->GetChildren(&nChildren)))
	{
		MessageBox(NULL, L"Could not Enumerate .X File", L"ERROR", MB_OK);
		return false;
	}

	for(SIZE_T index = 0; index < nChildren; index++)
	{
		if(SUCCEEDED(pEnum->GetChild(index, &pDataObj)))
		{
			if(!pDataObj->IsReference())
			{
				GetObjectName(pDataObj);
				ParseObject(pDataObj, Depth, NULL);
				pDataObj->Release();
			}
		}
	}
	pEnum->Release();
	pDXFile->Release();

	return TRUE;
}
BOOL CXParser::ParseChildObjects(LPD3DXFILEDATA pDataObj, DWORD Depth, void **Data)
{
	LPD3DXFILEDATA		pSubData = NULL;
	SIZE_T				nChildren = NULL;	
	Depth++;

	if(pDataObj->IsReference())
		return true;
	if(FAILED(pDataObj->GetChildren(&nChildren)))
	{
		MessageBox(NULL, L"Could not Enumerate .X File", L"ERROR", MB_OK);
		return false;
	}
	for(SIZE_T index = 0; index < nChildren; index++)
	{
		if(SUCCEEDED(pDataObj->GetChild(index, &pSubData)))
		{
			if(!pSubData->IsReference())
			{
				GetObjectName(pSubData);
				ParseChildObjects(pSubData, Depth, NULL);	
				pSubData->Release();
			}
		}
	}
	return true;
}

const GUID *CXParser::GetObjectGUID(LPD3DXFILEDATA pDataObj)
{
	// Retrieve the GUID of the Object's Template
	GUID *pTemplateGUID = NULL;
	if(FAILED(pDataObj->GetType(pTemplateGUID)))
		return NULL;
	return pTemplateGUID;
}

char *CXParser::GetObjectName(LPD3DXFILEDATA pDataObj)
{
	char *Name = NULL;
	DWORD dwSize;

	// Retrieve the Name of the Object's Template
	if(FAILED(pDataObj->GetName(NULL, &dwSize)))
		return NULL;
	
	if(dwSize>1){
		if((Name = new char[dwSize]) != NULL)
		pDataObj->GetName(Name, &dwSize);
	}
	
	// Give template a default name if none found
	if(dwSize<=1) {
		Name = new char[8];
		strcpy_s(Name, sizeof(char)*8, "Unknown");
	}
	MessageBoxA(NULL, (LPCSTR)Name, "Data Object Found", MB_OK); 
	return Name;
}
Does anyone have any ideas why the returned value from pDXFile->CreateEnumObject(...) would return D3DXFERR_PARSEERROR (HRESULT)? I would really appreciate some help with this! Thanks in advance!