VC2005 Unicode模式下,字符串转换有关问题(有代码帮看下是哪不对,多谢)

VC2005 Unicode模式下,字符串转换问题(有代码帮看下是哪不对,谢谢)
bool RenderFile(const char * inFile)
{
  int len;
WCHAR szFilePath[MAX_PATH];
//把传入的文件名转换成宽字符串
len=MultiByteToWideChar(CP_ACP,0,inFile,-1,szFilePath,MAX_PATH); //len为什么一直为1

......//这里略掉N多行代码,我的感觉是上面哪句没有转换成功,所以一直不会返回true
if(...)
  return true;

return false; // 正常是不会执行这一句的,因为

}
//--------------

bool test(const CString &strSourceFile)
{

//Unicode模式下,把CString 转换成Char
wchar_t *wchar;
CString str=strSourceFile;
wchar=str.GetBuffer();
str.ReleaseBuffer();
size_t convertedChars=0;
size_t sizeInBytes=((str.GetLength()+1)*2);
char *p=(char *)malloc(sizeInBytes);
wcstombs_s(&convertedChars,p,sizeInBytes,wchar,sizeInBytes);  

if (!RenderFile(p))//这里总为false
{  
MessageBox(__T("出错了"),__T("系统提示"),MB_ICONWARNING);
return false;
}
  return true;
}

------解决方案--------------------
使用 CW2A() 和 CA2W() 就是了。
------解决方案--------------------
先写一个函数 , CStringW => CStringA 的以后复用就可以了,
------解决方案--------------------
你不是问过吗?现在的问题是你传进来的 const char * inFile,到底是什么格式的?从你的描述上看,你传进来的可能就是unicode的了。