MinnisotaFreezing
Programmer
I created a stock MFC CView. The only fucntion I added is as follows:
The program crashes when I "x" out to close, on relese only. It runs fine in debug.
Any Ideas?
Code:
void CFtp4View::OnConnect()
{
CInternetSession MySession;
CString string;
AfxGetMainWnd()->SetWindowText("Transfering");
try
{
CFtpConnection * MyFtpConnection = MySession.GetFtpConnection("[URL unfurl="true"]www.dynacomproducts.com",[/URL] "dynaco", "dynacom51");
BOOL result = MyFtpConnection->PutFile("C:\\Dynacom\\Dynapro.mdb", "Dynapro.mdb");
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), 0,(LPTSTR) &lpMsgBuf,0,NULL);
string = (LPCTSTR)lpMsgBuf;
if (result)
{
c_Text.SetWindowText(string);
string = "File Placed";
}
else
c_Text.SetWindowText(string);
WINDOWPLACEMENT WindowInfo;
AfxGetMainWnd()->GetWindowPlacement(&WindowInfo);
WindowInfo.showCmd = SW_SHOWNORMAL;
AfxGetMainWnd()->SetWindowPlacement(&WindowInfo);
AfxGetMainWnd()->FlashWindow(TRUE);
GetParentFrame()->BringWindowToTop();
AfxGetMainWnd()->SetWindowText("Completed");
MessageBox(string);
}
catch (CInternetException* pEx)
{
TCHAR sz[1024];
pEx->GetErrorMessage(sz, 1024);
MessageBox(sz);
c_Text.SetWindowText(sz);
}
}
The program crashes when I "x" out to close, on relese only. It runs fine in debug.
Any Ideas?