Click here to Skip to main content
16,016,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralVC7 can't find source files Pin
Jim A. Johnson6-May-02 8:12
Jim A. Johnson6-May-02 8:12 
GeneralRe: VC7 can't find source files Pin
Tom Archer6-May-02 12:55
Tom Archer6-May-02 12:55 
GeneralDrawing transparent bitmap ... Pin
Hadi Rezaee6-May-02 8:05
Hadi Rezaee6-May-02 8:05 
GeneralRe: Drawing transparent bitmap ... Pin
Shog96-May-02 8:28
sitebuilderShog96-May-02 8:28 
GeneralRe: Drawing transparent bitmap ... Pin
Hadi Rezaee6-May-02 9:11
Hadi Rezaee6-May-02 9:11 
GeneralRe: Drawing transparent bitmap ... Pin
Paul M Watt6-May-02 8:29
mentorPaul M Watt6-May-02 8:29 
GeneralRe: Drawing transparent bitmap ... Pin
Hadi Rezaee6-May-02 9:17
Hadi Rezaee6-May-02 9:17 
GeneralException handling under XP Pin
Parish6-May-02 8:04
Parish6-May-02 8:04 
An app which has worked fine under W2K crashes in the exception handler under XP both with the binary built under W2K or XP, using VC++6.

It happens at the END_CATCH line in the code below (generates an access
violation at 0xc0000005) if the file does not exist.

It worked fine in W2K. What is different between W2K and XP that could cause this?

BOOL CUnembedDlg::OpenFile(CString f_name)
{
TRY
{
// Open the file in text mode to do
// CR-LF -> LF converison.
CStdioFile cstdf(f_name, CFile::typeText | CFile::modeRead);

DWORD f_size = cstdf.GetLength();
LPTSTR s = file.GetBufferSetLength((int)f_size);

cstdf.Read(s, (UINT)f_size);

cstdf.Close();

file.ReleaseBuffer(-1);

m_FileSize = file.GetLength();

if (-1 == file.Find("embedded-sysfiles", 0))
{
CString err_msg = "File not recognized";

MessageBox(err_msg, f_name, MB_OK | MB_ICONERROR);
m_combo1.SendMessage(WM_SETFOCUS, 0, 0);
m_combo1.Clear();
return false;
}

return true;
}
CATCH(CFileException, e)
{
e->ReportError();
e->Delete();

m_combo1.SendMessage(WM_SETFOCUS, 0, 0);
m_combo1.Clear();
m_combo1.RemoveFromMRU(f_name);
m_combo1.RefreshCtrl();
}
END_CATCH

return false;
}



while (!asleep)
code();
GeneralRe: Exception handling under XP Pin
Matt Gullett6-May-02 10:13
Matt Gullett6-May-02 10:13 
GeneralRe: Exception handling under XP Pin
Parish8-May-02 5:27
Parish8-May-02 5:27 
GeneralMultiple Dialogs Pin
tordyvel6-May-02 7:33
tordyvel6-May-02 7:33 
GeneralRe: Multiple Dialogs Pin
KingsGambit6-May-02 7:53
KingsGambit6-May-02 7:53 
GeneralRe: Multiple Dialogs Pin
Paul M Watt6-May-02 8:01
mentorPaul M Watt6-May-02 8:01 
GeneralRe: Multiple Dialogs Pin
Tom Archer6-May-02 12:40
Tom Archer6-May-02 12:40 
GeneralPresentation question Pin
HenrikO6-May-02 7:03
HenrikO6-May-02 7:03 
GeneralRe: Presentation question Pin
Rama Krishna Vavilala6-May-02 7:09
Rama Krishna Vavilala6-May-02 7:09 
GeneralUsing MFC on Windows XP Pin
6-May-02 6:55
suss6-May-02 6:55 
GeneralRe: Using MFC on Windows XP Pin
Andrew Peace6-May-02 11:09
Andrew Peace6-May-02 11:09 
GeneralRe: Using MFC on Windows XP Pin
7-May-02 4:22
suss7-May-02 4:22 
QuestionOpen a MSWord app into my window ? Pin
6-May-02 6:48
suss6-May-02 6:48 
AnswerRe: Open a MSWord app into my window ? Pin
6-May-02 6:49
suss6-May-02 6:49 
AnswerRe: Open a MSWord app into my window ? Pin
6-May-02 6:50
suss6-May-02 6:50 
AnswerRe: Open a MSWord app into my window ? Pin
KingsGambit6-May-02 8:01
KingsGambit6-May-02 8:01 
GeneralWhen i press my checkbox, no check appears... Pin
6-May-02 6:43
suss6-May-02 6:43 
GeneralRe: When i press my checkbox, no check appears... Pin
Tim Smith6-May-02 6:50
Tim Smith6-May-02 6:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.