• Advertisement
Sign in to follow this  

error C3861: 'CA2W' identifier not found

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was trying to learn DirectX via a tutorial, and I was working on using meshes with included textures, but when I try to compile the code *in VC++ 2005 Express* I get the error "...first.cpp(262) : error C3861: 'CA2W' : identifier not found" I've tried googling this to find some help, but nothing worthwhile came up that I saw. I also tried searching for CA2W on the gamedev forums, but didn't see anything. So here I am. I've included the atlbase.h file (#include <atlbase.h>) Any ideas? Bigfoot

Share this post


Link to post
Share on other sites
Advertisement
Try searching the MSDN. I haven't (I'm lazy), but I think it is something to do with converting A(scii) 2(to) W(ide characters = unicode).

Maybe you could try compiling in non-unicode mode too, if it is supported these days.

Share this post


Link to post
Share on other sites
{
LPD3DXBUFFER bufShipMaterial;

D3DXLoadMeshFromX(L"airplane 2.x",
D3DXMESH_SYSTEMMEM,
d3ddev,
NULL,
&bufShipMaterial,
NULL,
&numMaterials,
&meshSpaceship);

D3DXMATERIAL* tempMaterials = (D3DXMATERIAL*)bufShipMaterial->GetBufferPointer();

material = new D3DMATERIAL9[numMaterials];
texture = new LPDIRECT3DTEXTURE9[numMaterials];

for(DWORD i = 0; i < numMaterials; i++)
{
material[i] = tempMaterials[i].MatD3D;
material[i].Ambient = material[i].Diffuse;
USES_CONVERSION;
if(FAILED(D3DXCreateTextureFromFile(d3ddev,
CA2W(tempMaterials[i].pTextureFilename),
&texture[i])))
texture[i] = NULL;
}

return;
}



There's the CA2W statement, 7 lines from the bottom
Bigfoot

Share this post


Link to post
Share on other sites
Yep, it's definitely converting from Ascii to Wide chars, the USES_CONVERSION macro is the giveaway. Have you checked the MSDN? Have you got the latest SDK? I thought it was A2W though, try that it may be a typo.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement