I keep getting a unhandled exception error when calling D3DX10CreateEffectFromFile.
Unhandled exception at 0x69056d41 in TestApp.exe: 0xC0000005: Access violation writing location 0xccccccdc.
Basically I'm building a class to load models, but started having this issue. I have a MeshLoader class that has all my shader variables like below. Also I replace my shader file with a basic one that I knew worked just to see what would happen and it still has the same issue.
The problem is in the InitializeShader function. This is from a function in the MeshLoader class called ImportMesh. ImportMesh has a lot of code in it, but here is the shader specific parts.
if (!(InitializeShader(device, L"basicEffect.fx")))
{
MessageBox(NULL, L"Failed to initialize mesh shader", L"ERROR", MB_ICONERROR);
return false;
}
Lastly is the InitializeShader function, the unhandled exception occurs when D3DX10CreateEffectFromFile is called.
bool MeshLoader::InitializeShader(ID3D10Device* device, std::wstring file)
{
HRESULT result;
ID3D10Blob* errorMessage;
well i thought i had this fixed but apparently not. I'm still getting the below message when i run the program. It breaks when D3DX10CreateEffectFromFile is called. I simplified the program tremendously to weed out problems and I'm basically down to a mesh class that can load a shader.
Error Message:
Unhandled exception at 0x69056d41 in AssimpTestApp.exe: 0xC0000005: Access violation writing location 0xcccccccc.
here is my simplified initializeshader function inside the MeshLoader class. All it is currently doing is calling D3DX10CreateEffectFromFile. this is also where the problem is. The only thing even close to a clue I'm getting out of this is when clicking on m_pBasicEffect while debugging it sometimes says CXX0017: Error: symbol "" not found. I've loaded shaders quite a few times and this is the first time I've had problems, so I don't see how it could be a project properties setting. I have also tried moving the shader code into the main cpp file and all works well. It just has the problem inside of my MeshLoader class. All shader related variables such as m_pBasicEffect are initialized to 0 in the class constructor.
Closing thread since OP solved problem.
But there's another problem: two posters posted answers, then went back and deleted them because OP solved his own problem. Deleting posts isn't cool.