Discussion:
Visual Studio 2008 Pro, CImageList crash when _AFX_NO_DAO_SUPPORT is defined
(too old to reply)
Petter
2007-11-23 10:11:21 UTC
Permalink
Can somebody please help me report this bug in Visual Studio 2008.

When you define _AFX_NO_DAO_SUPPORT in stdafx.h CImageList will crash, but
only in Release mode.
I use XP SP2 and downloaded the RTM version of VS2008 Pro from MSDN.

Steps to reproduce:

// STEP 1: Add this to stdafx.h before #include <afxwin.h>

#define _AFX_NO_DAO_SUPPORT /* Makes CImageList methods crash in VS2008
:-( */
#define OEMRESOURCE /* For CBitmap::LoadOEMBitmap(OBM_CHECKBOXES);*/


// STEP 2: Add this code anywhere, for example in YourApp::InitInstance()
{
// Load some bitmap and create imagelist - no problems here
CBitmap bmImage; bmImage.LoadOEMBitmap(OBM_CHECKBOXES); // Or any other
bitmap
BITMAP bmInfo; bmImage.GetObject(sizeof bmInfo, &bmInfo); // Get size for
iml.Create()
CImageList iml; VERIFY( iml.Create(bmInfo.bmHeight,bmInfo.bmHeight,
ILC_MASK, 0, 1) );

// Problems start here
// #define _AFX_NO_DAO_SUPPORT before #include <afxwin.h> in stdafx.h
results in:
// Unhandled exception 0xC0000005: Access violation reading location
0x00000003.

iml.Add( &bmImage, RGB(192,192,192) ); // Crash
HICON hIcon = iml.ExtractIcon( 0 ); // Crash
}

Best regards, Petter
David Lowndes
2007-11-23 11:04:59 UTC
Permalink
Post by Petter
Can somebody please help me report this bug in Visual Studio 2008.
Petter,

You can report the problem on the connect.microsoft.com site.

Dave
Petter
2007-11-23 12:57:12 UTC
Permalink
ok, I found out how now, but VS2008 RTM is not selectable yet - only the
Beta and CTP versions.
Post by David Lowndes
Post by Petter
Can somebody please help me report this bug in Visual Studio 2008.
Petter,
You can report the problem on the connect.microsoft.com site.
Dave
David Lowndes
2007-11-23 14:07:02 UTC
Permalink
Post by Petter
ok, I found out how now, but VS2008 RTM is not selectable yet - only the
Beta and CTP versions.
I'd file it against the last beta and add a note in there that the RTM
version exhibits the problem.

Be sure to supply a small buildable project that reproduces the issue
- that way someone won't have to work hard to verify it and it'll
stand more chance of getting seen.

Dave
Charles Wang[MSFT]
2007-11-26 09:17:55 UTC
Permalink
Hi,
This is a quick note to let you know that I am performing research on this
issue and may need more time to get back to you. I appreicate your patience.

Please feel free to let me know if you have any questions or concerns.

Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
Petter
2007-11-26 12:24:13 UTC
Permalink
Thank you, it is reported here:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=312204
I came around the bug by using a namespace instead of using
_AFX_NO_DAO_SUPPORT to prevent conflicts.
Post by Charles Wang[MSFT]
Hi,
This is a quick note to let you know that I am performing research on this
issue and may need more time to get back to you. I appreicate your patience.
Please feel free to let me know if you have any questions or concerns.
Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
Charles Wang[MSFT]
2007-11-27 11:28:44 UTC
Permalink
Hi Petter,
Thanks for your feedback.

I agree that your current workaround is fine. Also I noticed that Visual
Studio Product Team had responded you under your feedback and escalated
this issue to the appropriate team, so this issue will be fixed in the next
release of Visual Studio.


Thanks again for your trust to Microsoft and have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support

======================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================

Loading...