473,606 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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". 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 AfxGetModuleSta te and
before a call to CComCtlWrapper: :_ImageList_XXX

disassembly:

004DE7F5 call AfxGetModuleSta te (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_Get Icon (49E158h)
( the last line can be interchanged by
CComCtlWrapper: :_ImageList_Get ImageCount (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 AfxGetModuleSta te 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/Sho...2410&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]
Dec 14 '05 #1
1 2585
"Robert Ludewig" <rl******@gmx.d e> wrote in message
news:Oz******** ******@tk2msftn gp13.phx.gbl...
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".
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 AfxGetModuleSta te and
before a call to CComCtlWrapper: :_ImageList_XXX

disassembly:

004DE7F5 call AfxGetModuleSta te (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_Get Icon (49E158h)
( the last line can be interchanged by
CComCtlWrapper: :_ImageList_Get ImageCount (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 AfxGetModuleSta te 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/Sho...2410&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]


That probably may be the bug of a compiler.
When you invoke function it stores the resulting value in EAX register. The
ECX register is used to store the offset on a class object, so when you
invoke CComCtlWrapper: :_ImageList_Get Icon it uses ECX inside to get an
access to the data of a class.
mov eax,dword ptr [eax+90h] ;
also seems strange to me. That probably not a bug of CImageList . Try to
rewrite that part of code using _asm keyword.

// pseudocode, I don't have VC8 over here..
__asm {
; make pushes if necessary
call AfxGetModuleSta te
mov ecx,eax
; make pushes if necessary
call CComCtlWrapper: :_ImageList_Get Icon }

--
Vladimir
Dec 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
8842
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and save it to the user's machine. I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
11
6579
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
8
19883
by: Paul | last post by:
Hi all may I know how to use C# DLL inside my VC++ Project ? Thanks in advance.
1
1287
by: | last post by:
Serious bug discovered in VC .NET (2002) compiler. Example below should work if I understand the Microsoft documentation correctly. Hopfelly there is some compiler upgrade that fixes this bug? class CTubeDev {
2
3117
by: vemulakiran | last post by:
Hi all, I have doubt regarding .NET. I have a tool which was developed on VC++ 6.0(Win32 Application ). The application communicates with library (API) which was developed on VC++ 6.0 called core client. I am planning to develop the tool or Win32 application on .NET platform and I dont' want to migrate the VC++ library (API) to .NET. The new .NET tool should use the previous VC++ library API ( core client ). Is there any possibility to...
1
1865
by: Steve | last post by:
We are considering the ways to migrate our VC++ 6.0 applications to .NET platform. It would be nice to rewrite them completely in C#, but due to the time constraints this option is out of question. We started from rewriting some dll in C# in Visual Studio .NET. Now we face chalenges of interoperation between old VC++ 6.0 apps and new .NET C# components. To solve this problem we considered the following options:
5
2044
by: Felix I. Wyss | last post by:
Good Afternoon, I recently noticed that some very simple methods of a template declared and used in a DLL library get inlined when used by the DLL itself, but not by other DLLs and EXEs. After some investigating, I narrowed this down to a very odd behavior (bug?) of the VC++.NET 2003 compiler: If a class that is declared as __declspec(dllimport) derives from a template, that template's methods are never inlined, even if declared with...
6
1887
by: Felix I. Wyss | last post by:
It appears that VC++2003 has a code generator bug related to template parameters that are a pointer-to-member type: If the actual template argument is a virtual method, VC generates code that always calls the method at the first vtable slot (index 0). To reproduce this bug, consider the following code: template<class CLASS_T, void (CLASS_T::*METHOD_T)(void)> class MethodCaller { public:
1
1596
by: Bern McCarty | last post by:
What do you make of this? I cannot tell for sure but it almost seems as the the transition thunk to get back from the native bool method to the managed caller is looking at eax and, if any bit is set, normalizing it to 0x00000001. If it wants to normalize the value then it should only operate on the al register since that's all that the native bool method uses to hold the return value. Is this a known VC 7.1 bug? Is there a hotfix...
0
8439
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8305
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5966
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5465
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3930
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1553
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1296
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.