Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C++ Libraries / January 2006

Tip: Looking for answers? Try searching our database.

vc++8.0 bug:  access violtation upon any call of any CImageList methods

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert Ludewig - 14 Dec 2005 17:42 GMT
I have sucessfully imported and compiled a complex MFC 6.0 project from
vc++6.0 (MFC6.0)  into vc++ 8.0 (MFC 8.0). It contains several
subprojects (libs and dlls). In vc++ 6.0 those project linked MFC6.0
statically and after I imported it to vc++ 8.0 I set the linkage of
MFC8.0 to "shared" (I want to introduce some c++/CLI code later).
However when I try to compile and link the project in vc++ 8.0 in
release mode (debugmode works fine) I get an acess violation in
afxcomctl32.inl. This happnes whenever I call any of the CImageList
methods. When I comment out all lines that call mehtods of CImageList
everything work fine in release mode too.

When I look at the disassembly the crash pattern is always the same. The
access violation always happens after a call of AfxGetModuleState and
before a call to CComCtlWrapper::_ImageList_XXX

disassembly:

004DE7F5  call        AfxGetModuleState (49CE2Ah)
004DE7FA  mov         eax,dword ptr [eax+90h] // it is always 90h added
004DE800  mov         ecx,dword ptr [eax]  <------------ access
violation !!!!
004DE802  call        CComCtlWrapper::_ImageList_GetIcon (49E158h)
( the last line can be interchanged by  
CComCtlWrapper::_ImageList_GetImageCount (49A805h) or any other call to
CImageList mehtods )

registers:

EAX = 00000004 EBX = 00180940 ECX = 781FF81B EDX = 782BA9DC
ESI = 7821A936 EDI = 00000000 EIP = 004DE800 ESP = 0012BB04
EBP = 0012BB5C EFL = 00000206

Can any explain what is going on here and give me hints how to solve
this problem? What does AfxGetModuleState do? What is afxcomctl32.inl ?  
What could be obvious places to look for ? Is this a know bug in vc++ 8?
I have found a bug in vc++ 8.0 that is STILL UNRESOLVED  that somehow
looks a little similar to mine:  
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=132410&SiteID=1

Nevertheless the problem described there and the workaround suggested
does not fit here, since all of my projects have the allignment set to
default and nowhere in my project I see any #pragma pack directives.

Also I wonder what the purpose of  the addition of 90h in this line is:
004DE7FA  mov         eax,dword ptr [eax+90h]
Nikola Dudar [MSFT] - 14 Dec 2005 23:16 GMT
Hi,

I do not recall any change in VC8 that may impact this scenario.
Unfortunately I cannot see topic on forums, looks like website is closed for
maintenance. I would recommend reducing your project to a small repro that
works in VC6 but AV on VC8. Then open a bug report to
http://lab.msdn.microsoft.com/productfeedback/. Our dev team will
investigate this and either fix the issue or recommend workaround.
Alternative way is contacting Developer Support team, they may help you with
that also.

Thanks,
Nikola

Signature

Nikola Dudar
Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Suggestions? Bugs? Talk directly to dev teams using
http://lab.msdn.microsoft.com/productfeedback/
My Blog - http://blogs.msdn.com/nikolad/

>I have sucessfully imported and compiled a complex MFC 6.0 project from
>vc++6.0 (MFC6.0)  into vc++ 8.0 (MFC 8.0). It contains several subprojects
[quoted text clipped - 40 lines]
> Also I wonder what the purpose of  the addition of 90h in this line is:
> 004DE7FA  mov         eax,dword ptr [eax+90h]
bonk - 15 Dec 2005 16:10 GMT
Can you give me a hint how to contact the Developer Support team ? We
have msdn (operating system) subscriptions (if that matters ...)

Nikola Dudar [MSFT] schrieb:
> Hi,
>
[quoted text clipped - 9 lines]
> Thanks,
> Nikola
Ted - 02 Jan 2006 17:09 GMT
For others still looking for info on this problem, here is the ongoing
thread on Microsoft forums:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=168836&SiteID=1

Ted.

>I have sucessfully imported and compiled a complex MFC 6.0 project from
>vc++6.0 (MFC6.0)  into vc++ 8.0 (MFC 8.0). It contains several subprojects
[quoted text clipped - 40 lines]
> Also I wonder what the purpose of  the addition of 90h in this line is:
> 004DE7FA  mov         eax,dword ptr [eax+90h]

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.