Hi everyone,

My MFC program stops at the following debugbreak when I start it:

4294813649 PID:a1ef5b5a TID:e1e68756 0x81e4b000: Unknown: DEBUGCHK failed in
file d:\jameson\private\winceos\coreos\gwe\controls\imgctl\.\imagelist.cpp
at line 905

and the code jumps to kfuncs.h, line 102 where it calls "debugbreak();"

#elif defined(x86)

_inline void DebugBreak() {
__asm int 3
}

I checked my pc and I don't have any imagelist file, but I have a imgctl lib
file. If I press F5, the application starts as is nothing has happened. But
I can't do the same with a release build, the application doesn't start.
This Debugbreak comes after the CChildView::OnCreate() returns 0 and before
CMyApp::InitInstance
{
................
pFrame->ShowWindow(m_nCmdShow);
pFrame->UpdateWindow();
}
lines are executed. I can't go with F11 until I find the debugbreak cal
because at some stage the CEPC restarts itself and the PB loses connection.
The same restart occurs when I want to debug my code using eVC and the
emulator. I have 2 threads

How can I solve this? Please help me.
Selin

RE: Where does this Debugbreak() int imagelist.cpp come from? by amjadh

amjadh
Mon Sep 08 14:23:13 CDT 2003

Have you tried to write a simple MFC test application and see if the same
problem reproduces? In other words, try to narrow down whether this is a
potential problem in your application or a more general issue.

Send me the callstack (in the debug build). Also, what type of an image
are you using?


This posting is provided "AS IS" with no warranties, and confers no rights.


Re: Where does this Debugbreak() int imagelist.cpp come from? by Selin

Selin
Tue Sep 09 03:13:49 CDT 2003

I have 2 different MFC applications: One of them is Single Document with
Document / View architecture support and the other is again Single Document
without Document/View architecture support. They don't have similar codes.
The first one initializes and opens without any problem. The problem exists
with the second one. This is the call stack of it:

////////////////////////////////////////////////////////////////////////////
///////////////////////////////////
GWES!DebugBreak() line 102
GWES!ImageList::GetImageCount(ImageList * 0x00000000) line 905 + 48 bytes
COREDLL!xxx_ImageList_GetImageCount(_IMAGELIST * 0x00000000) line 24 + 11
bytes
MFCCE400D!CCeCommandBar::AddAdornments(unsigned long 0x00000000) line 826 +
10 bytes
00000a1d()
00030a7d()
000303dd()
0002e80f()
0002ec40()
00072b10()
00003559()
COREDLL!xxx_PerformCallBack4(_CALLBACKINFO *) line 30 + 23 bytes
GWES!CWindow::CallWindowProcWInternal(CePtr_t<long (__cdecl*)(HWND__
*,unsigned int,unsigned int,long)> {...}, HWND__ *, unsigned int, unsigned
int, long, SendMsgEntry_t *) line 2454 + 21 bytes
GWES!MsgQueue::SendMessageWithOptions(HWND__ *, unsigned int, unsigned int,
long, unsigned int) line 3603 + 34 bytes
GWES!CWindowManager::CreateWindowExW_I(unsigned int, const unsigned short *,
const unsigned short *, unsigned int, int, int, unsigned int, unsigned int,
HWND__ *, HMENU__ *, HINSTANCE__ *, void *, tagCREATESTRUCTW *) line 770 +
19 bytes
COREDLL!xxx_CreateWindowExW(unsigned long, const unsigned short *, const
unsigned short *, unsigned long, int, int, int, int, HWND__ *, HMENU__ *,
HINSTANCE__ *, void *) line 116 + 59 bytes
0002efda()
0005bb4f()
0005c04e()
00000715()
0000117a()
00002ae8()
00002817()
COREDLL!MainThreadBaseFunc(void *, unsigned long, unsigned long, unsigned
long, unsigned long) line 412 + 19 bytes
////////////////////////////////////////////////////////////////////////////
//////////////////////////////////

From this output I understand that the assertion causing the DebugBreak() is
not called from one of my functions. This problem does not exist with the
Release build, but I can't run the Debug build without pressing F5 at the
DEBUGCHK breakpoint.
My code creates a new window in the OnCreate member function of the
CChildView class. I have a very simple menu, only connect(with a pull-down
menu o 2 items) and help items.



"Amjad Hussain [MS]" <amjadh@online.microsoft.com> wrote in message
news:vht#q6jdDHA.2000@cpmsftngxa06.phx.gbl...
> Have you tried to write a simple MFC test application and see if the same
> problem reproduces? In other words, try to narrow down whether this is a
> potential problem in your application or a more general issue.
>
> Send me the callstack (in the debug build). Also, what type of an image
> are you using?
>
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>



Re: Where does this Debugbreak() int imagelist.cpp come from? by Steve

Steve
Tue Sep 09 07:16:50 CDT 2003

FYI, You are not the only one seeing this. It seems to be an issue on a
number of systems. Though I've only been dealing with that on ARMV4I debug
builds. (I don't know if it occurs on ARMV4 also)

--
Steve Maillet (eMVP)
Entelechy Consulting
smaillet_AT_EntelechyConsulting_DOT_com



Re: Where does this Debugbreak() int imagelist.cpp come from? by Selin

Selin
Wed Sep 10 08:49:38 CDT 2003

My system is X86 based CEPC. Its specifications are:
PC/104 ZFx86 processor
32 MB RAM
DOC
CRT SVGA interface
Fast Ethernet (Rtl8139C)

My development PC is Intel P4 1.51 GHz processor 764 MB RAM Windows XP Pro.

I have encountered this a couple of times more, but my code had some errors
then so I thought it was my code that made Windows CE to jump to the
DebugBreak. This time I'm sure that my code is flawless so I want to get rid
of this annoying debugbreak.


"Steve Maillet (eMVP)" <nospam1@EntelechyConsulting.com> wrote in message
news:#MKZwysdDHA.904@TK2MSFTNGP11.phx.gbl...
> FYI, You are not the only one seeing this. It seems to be an issue on a
> number of systems. Though I've only been dealing with that on ARMV4I debug
> builds. (I don't know if it occurs on ARMV4 also)
>
> --
> Steve Maillet (eMVP)
> Entelechy Consulting
> smaillet_AT_EntelechyConsulting_DOT_com
>
>



Re: Where does this Debugbreak() int imagelist.cpp come from? by pablocan

pablocan
Sat Sep 13 21:30:38 CDT 2003


This break is produced beacuse the Imagelist pointer is not longer valid.
Try to figure out who might be deleting / corrupting this pointer.

You can always keep using GetImageCount API to validate the hanlde to the
Imagelist at any time.
It should assert on debug and will always return ZERO if something is wrong



Re: Where does this Debugbreak() int imagelist.cpp come from? by Selin

Selin
Mon Sep 15 01:32:52 CDT 2003

I'm not using any one of imagelist_xxx APIs, so how can I use
Imagelist_GetImageCount to validate the handle? Besides, why this does not
happen in release build?

"J. Pablo Candelas [MS]" <pablocan@online.microsoft.com> wrote in message
news:opfF6gmeDHA.2324@cpmsftngxa06.phx.gbl...
>
> This break is produced beacuse the Imagelist pointer is not longer valid.
> Try to figure out who might be deleting / corrupting this pointer.
>
> You can always keep using GetImageCount API to validate the hanlde to the
> Imagelist at any time.
> It should assert on debug and will always return ZERO if something is
wrong
>
>



Re: Where does this Debugbreak() int imagelist.cpp come from? by pablocan

pablocan
Tue Sep 16 15:14:04 CDT 2003


I look closely at callstack, this seems to be imagelist used by toolbar of
your app.
(the null handle shouldn't have made it to the Imagelist call since toolbar
code checks against it..)

Which CE version are you using?

J. Pablo Candelas

--------------------------------------------------------------------------

This posting is provided "AS IS" with no warranties, and confers no rights.


Re: Where does this Debugbreak() int imagelist.cpp come from? by Selin

Selin
Wed Sep 17 02:39:11 CDT 2003

I'm using Windows CE .NET 4.1 licensed full version. I found the following
posting in this newsgroup which states an imagelist problem very similar to
mine. Since the toolbar operations are made by the code written by MFC app
wizard, I don't know how to handle this. As far as I understand, this is a
frequent problem which occurs in some MFC applications. Anyway, I prefer
that it doesn't occur.

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=uqOmPJ6hAHA.1580%
40tkmsftngp02&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DISO-8859-1%26q%3D
imagelist%2Boskar%26btnG%3DGoogle%2BSearch%26meta%3Dgroup%253Dmicrosoft.publ
ic.windowsce.*

The following is the OnCreate function code written by the app wizard. I
haven't changed a single comma in it.

////////////////////////////////////////////////////////////////////////////
/////////////
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// create a view to occupy the client area of the frame
if (!m_wndView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
{
TRACE0("Failed to create view window\n");
return -1;
}

if(!m_wndCommandBar.Create(this) ||
!m_wndCommandBar.InsertMenuBar(IDR_MAINFRAME) ||
!m_wndCommandBar.AddAdornments(dwAdornmentFlags))
{
TRACE0("Failed to create CommandBar\n");
return -1; // fail to create
}

m_wndCommandBar.SetBarStyle(m_wndCommandBar.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_FIXED);

return 0;
}
////////////////////////////////////////////////////////////////////////



"J. Pablo Candelas [MS]" <pablocan@online.microsoft.com> wrote in message
news:4vJaY8IfDHA.832@cpmsftngxa07.phx.gbl...
>
> I look closely at callstack, this seems to be imagelist used by toolbar of
> your app.
> (the null handle shouldn't have made it to the Imagelist call since
toolbar
> code checks against it..)
>
> Which CE version are you using?
>
> J. Pablo Candelas
>
> --------------------------------------------------------------------------
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>



Re: Where does this Debugbreak() int imagelist.cpp come from? by Selin

Selin
Thu Sep 18 03:31:32 CDT 2003

I checked this by creating an MFC application with the appwizard. If I
choose single document WITHOUT document / view architecture support, the
application jumps to DebugBreak( ) whenever the execution comes to the
CCeCommandBar::AddAdornments(...) in CMainFrame::OnCreate(...). I continue
by pressing F5.

If I create the MFC application with the appwizard choosing single document
WITH document / view architecture support, this DebugBreak error never
occurs.

Since in both options I didn't write a single line of code by myself and
everything is done by the appwizard, this problem must be related with the
implementation of AddAdornments function in MFC framework. It seems that it
is harmless but is annoying and causes a little time loss.

PS. I'm using Windows CE .NET 4.1, eVC 4.0 sp.2, and my platform is x86
CEPC. The specifications of my pc/104 board are:
My system is X86 based CEPC. Its specifications are:
PC/104 ZFx86 processor
32 MB RAM
DOC
CRT SVGA interface
Fast Ethernet (Rtl8139C)

Selin Metin



Re: Where does this Debugbreak() int imagelist.cpp come from? by pablocan

pablocan
Thu Sep 18 13:20:15 CDT 2003


MFC team is investigating this issue. Yesterday they could not repro this
issue and would like to get a little more information.

" I took a look at this and could not get the issue to repro with the
information given. Could you get more detailed steps from the customer on
how to repro the issue? I had to do some guess work on the project
settings, so it would be helpful to get exact project settings. Also, a
list of changes made to the default project code would be very helpful. "

Thanks,
J. Pablo Candelas

--------------------------------------------------------------------------

This posting is provided "AS IS" with no warranties, and confers no rights.


Re: Where does this Debugbreak() int imagelist.cpp come from? by Ian

Ian
Thu Sep 18 15:28:03 CDT 2003

Perhaps it's an imagelist created from a resource file, and the imagelist
creation fails because the resource is missing?
-Ian

"J. Pablo Candelas [MS]" <pablocan@online.microsoft.com> wrote in message
news:XXDJFGhfDHA.1544@cpmsftngxa06.phx.gbl...
>
> MFC team is investigating this issue. Yesterday they could not repro this
> issue and would like to get a little more information.
>
> " I took a look at this and could not get the issue to repro with the
> information given. Could you get more detailed steps from the customer on
> how to repro the issue? I had to do some guess work on the project
> settings, so it would be helpful to get exact project settings. Also, a
> list of changes made to the default project code would be very helpful. "
>
> Thanks,
> J. Pablo Candelas
>
> --------------------------------------------------------------------------
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>