Public Group

# Odd error....

This topic is 3871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I've run in to a snag. Whenever running my application(2008 Exp) it breaks with a dialog that states "There is no source code available for the current location". This occurs on a line whereby I am loading an X file.
Room->InitGeomFromFile("spiral.x");


This equates too:
	void InitGeomFromFile(std::string Filename)
{
LPD3DXBUFFER bufMaterial;

D3DXLoadMeshFromX(Filename.c_str(), D3DXMESH_SYSTEMMEM, PD->GetDirectXDevice(), NULL, &bufMaterial, NULL, &numMaterials, &pMesh);
IsPrim    = false;
IsCreated = true;

Texture = new LPDIRECT3DTEXTURE9[numMaterials];
D3DXMATERIAL* tempMaterials = (D3DXMATERIAL*)bufMaterial->GetBufferPointer();

HRESULT b;

for(DWORD i = 0; i < numMaterials; i++)
{
//	USES_CONVERSION;

if(FAILED(b = D3DXCreateTextureFromFile(PD->GetDirectXDevice(), /*CA2W(*/tempMaterials.pTextureFilename/*)*//*L"c:\\s.dds"*/, &Texture)))
{
//DXGetErrorString9(
/*const WCHAR *szError =*/
std::stringstream str;
str << "Blah() failed (" << DXGetErrorString9(b) << "): " << DXGetErrorDescription9(b) << "\n";
//		OutputDebugString(CA2W(tempMaterials.pTextureFilename));
std::cout << "Blah() failed (" << b << "\n";
Texture = NULL;
}

D3DVERTEXELEMENT9 test_decl[] =
{
{0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0},
{0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0},
{0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0},
{0, 36, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0},
{0, 48, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BINORMAL, 0},
D3DDECL_END()
};
pMesh->CloneMesh(D3DXMESH_MANAGED, test_decl, PD->GetDirectXDevice(), &sMesh);
D3DXComputeTangent(sMesh, 0, 0, 0, 0, NULL);
//D3DXComputeMesh(
}
}


Please excuse the messy code. I'm still very much learning. Now, the curious thing is. If I change the line too:
Room->InitGeomFromFile("room.x");


It runs fine and without exception. I checked the "spiral.x" with DirectX viewer and it loads fine. I also checked it in the model viewer for the middleware engine I was using before deciding to switch to pure DX, it loads fine there too. I also googled and turned up a few results. But none of which explain why I am incurring this issue. The MSDN describes it as:
Quote:
 Your project does not contain source code for the code you are trying to view. The usual cause is double-clicking a module that does not have source in the Call Stack Window or Threads Window.
Or:
Quote:
 Another possible cause is trying to debug a dump file for managed code.
I'm not double clicking on anything and my code is not managed. I have cleaned the solution and rebuilt it( after reading a thread on the MS forum ). I have also searched this forum, but the two threads I found of interest were incomplete and didn't provide information or a solution. However, based on the questions asked in those threads by the respondents I can tell you that I am using the debug with the output set fully on "more". The call stack seems to break on the line:
>	d3dx9_36.dll!6901182a()


With the following information on the line below:
 	[Frames below may be incorrect and/or missing, no symbols loaded for d3dx9_36.dll]


This half makes sense to me, but as a newbie I have no idea why this only occurs with one X file and not the other? :s. So I'm highly confused. I'm really not sure how to even go about debugging this as I have no idea what it means. Could someone who understands please throw a couple keywords my way so I can google further -- or indeed if you have encountered this before and can explain where I'm going wrong? Thank you.

[post deleted]

##### Share on other sites
The error indiceated that your program has broken at a point where the source code is not availible. This means its probably code thats in a dll somewhere. Other than that i'm not sure that i can help you. Are room.x and spiral.x in the same directory? Both read/writable?

If one .x file works over another then that indicates to me there is a difference in the files. That might be a good place to start looking.

##### Share on other sites
I don't know what I did, but I've managed to get it loading. It now breaks on the "D3DXComputeTangent(sMesh, 0, 0, 0, 0, NULL);" line. Which is probably the most important line as far as I'm concerned cause I need that for my shader. But in any case, I think I can take it from here.

Thank you for your help JimmyDeemo.

1. 1
Rutin
28
2. 2
3. 3
4. 4
5. 5

• 13
• 11
• 10
• 13
• 20
• ### Forum Statistics

• Total Topics
632948
• Total Posts
3009404
• ### Who's Online (See full list)

There are no registered users currently online

×