From: Weichao Wang on
Hi all,
After I've assigned a variable to an edit control, the project can be
compiled without error, but at execution an error occurs:
Unhandled exception in prog.exe: 0xC0000005: Access Violation.
The program stopped within the method InitInstance() in the code line:
m_pMainWnd = &dlg;
i.e. the program does not reach my own code.
This is in Visual C++ 6.0.
Has someone a clue for this? many thanks in advance!
--
Weichao Wang
From: Scott McPhillips [MVP] on
"Weichao Wang" <weichao_wang(a)hotmail.com> wrote in message
news:5009889D-AA6C-41B1-B590-246FAF8B60C1(a)microsoft.com...
> Hi all,
> After I've assigned a variable to an edit control, the project can be
> compiled without error, but at execution an error occurs:
> Unhandled exception in prog.exe: 0xC0000005: Access Violation.
> The program stopped within the method InitInstance() in the code line:
> m_pMainWnd = &dlg;
> i.e. the program does not reach my own code.
> This is in Visual C++ 6.0.
> Has someone a clue for this? many thanks in advance!
> --
> Weichao Wang

Single step into the problem area with the debugger. One possibility is
that the previous line of code created dlg, which means it executed any code
you may have in the dlg constructor.

--
Scott McPhillips [VC++ MVP]

From: Alexander Grigoriev on
Try to do full rebuild. Sometimes changes in .h files don't trigger build of
all affected sources.

"Weichao Wang" <weichao_wang(a)hotmail.com> wrote in message
news:5009889D-AA6C-41B1-B590-246FAF8B60C1(a)microsoft.com...
> Hi all,
> After I've assigned a variable to an edit control, the project can be
> compiled without error, but at execution an error occurs:
> Unhandled exception in prog.exe: 0xC0000005: Access Violation.
> The program stopped within the method InitInstance() in the code line:
> m_pMainWnd = &dlg;
> i.e. the program does not reach my own code.
> This is in Visual C++ 6.0.
> Has someone a clue for this? many thanks in advance!
> --
> Weichao Wang


From: Weichao Wang on
That's the point! Thank you, Alexander!
--
Weichao Wang


"Alexander Grigoriev" wrote:

> Try to do full rebuild. Sometimes changes in .h files don't trigger build of
> all affected sources.
>
> "Weichao Wang" <weichao_wang(a)hotmail.com> wrote in message
> news:5009889D-AA6C-41B1-B590-246FAF8B60C1(a)microsoft.com...
> > Hi all,
> > After I've assigned a variable to an edit control, the project can be
> > compiled without error, but at execution an error occurs:
> > Unhandled exception in prog.exe: 0xC0000005: Access Violation.
> > The program stopped within the method InitInstance() in the code line:
> > m_pMainWnd = &dlg;
> > i.e. the program does not reach my own code.
> > This is in Visual C++ 6.0.
> > Has someone a clue for this? many thanks in advance!
> > --
> > Weichao Wang
>
>
> .
>