有关DLL有关问题

有关DLL问题
写了这么一段代码

void CDialog1Dlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here

HMODULE hmdoule;
hmdoule = LoadLibrary(_T("MyDll.dll"));
typedef int (*MYPROC)(int x,int y);
MYPROC myproc;
myproc = (MYPROC)GetProcAddress(hmdoule,"add");
TCHAR buf[7];
sprintf(buf,_T("x+y=%d"),myproc(5,8));
AfxMessageBox(buf,MB_OK);
FreeLibrary(hmdoule);
}

提示错误信息为:
error C2664: 'sprintf' : cannot convert parameter 1 from 'TCHAR [7]' to 'char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

有哪位大侠知道是错在哪里啊


------解决方案--------------------
swprintf
------解决方案--------------------
TCHAR buf[7];
把这个初始化一下试试
------解决方案--------------------
sprintf是ANSI,换成swprintf
------解决方案--------------------
建议使用StringCchPrintf