Original Post
I''m loading a .x file into my program, and the following code gives me an access violation during the dxFData->GetType(&guidDataType) call. I''ve tried changing it around a lot and I''m not sure why guidDataType is corrupt and unusable in the function. Anyone who knows about this sorta stuff, I''d appreciate any help I can get.
IDirectXFile *dxF;
if ( DXFILE_OK != DirectXFileCreate(&dxF) )
return ERR_BADFILE;
IDirectXFileEnumObject *dxFEnumObject;
if ( DXFILE_OK != dxF->CreateEnumObject(strFilename, DXFILELOAD_FROMFILE,
&dxFEnumObject) )
return ERR_BADFILE;
HRESULT hr;
IDirectXFileData *dxFData;
while(1) {
hr = dxFEnumObject->GetNextDataObject(&dxFData);
if ( hr == DXFILEERR_NOMOREOBJECTS )
break;
else if ( hr == DXFILEERR_BADVALUE ) {
break; return ERR_BADFILE;
} else {
const GUID *guidDataType;
if ( DXFILE_OK != dxFData->GetType(&guidDataType) ) {
break; return ERR_BADFILE;
}
}
}
|