I have been tasked by my employer to convert an old code written in Visual C++6.0 to Visual C++ 2010.
How can I convert the function below to Visual C++ 2010? All my previous Attempts lead to memory errors on Visual C++2010.
The function CI_CompileProgram is actually in a DLL and the declaration is
STDCALL CI_CompileProgram(wchar_t* wsXMLFile, wchar_t* wsSavePath);Function to be updated starts below ..........
void Compiler_now::OnFileCompile(){
// TODO: Add your command handler code here
CFileDialog dlg(TRUE, _T("xml"), NULL, OFN_FILEMUSTEXIST, _T("xml file(*.xml) | *.xml"));
if(dlg.DoModal() == IDOK)
{
CString strPath = dlg.GetPathName();
int len = strPath.ReverseFind(L'\\');
CString strSave = strPath.Left(len);
if(CI_CompileProgram(strPath.GetBuffer(strPath.GetLength()), strSave.GetBuffer(strSave.GetLength())))
MessageBox(_T("Compilation is complete!"));
else
MessageBox(_T("Compilation is failed!"));
}
}