472,363 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,363 software developers and data experts.

Virtual bool bug in VS2005 ?

Hello,

Does anyone know if the "virtual bool bug" is still present in VS2005 when
calling between managed and unmanaged code?

Thanks

Kevin
Nov 17 '05 #1
5 1061
Kevin Frey wrote:
Hello,

Does anyone know if the "virtual bool bug" is still present in VS2005
when calling between managed and unmanaged code?


No, it's fixed.

-cd
Nov 17 '05 #2
Carl Daniel [VC++ MVP] wrote:
Kevin Frey wrote:
Hello,

Does anyone know if the "virtual bool bug" is still present in VS2005
when calling between managed and unmanaged code?


No, it's fixed.


The good question being : where has it been fixed? In the compiler or in the
..NET runtime ;-)

Arnaud
MVP - VC
Nov 17 '05 #3
Hi Arnaud!
Does anyone know if the "virtual bool bug" is still present in VS2005
when calling between managed and unmanaged code?


No, it's fixed.


The good question being : where has it been fixed? In the compiler or in the
..NET runtime ;-)


The compiler was not the problem... the problem occured during the
unmanaged-to-managed transition, so it must be fixed in the .NET-Framework.
For the VC7(.1) bug see:
http://www.codeproject.com/buglist/virtualboolbug.asp

I just can remember the reason for this bug: The compiler and the
framework team discussed who should solve the problem (and then they
forgot to solve it :-) )

The CLR team said the "bool(ean)" is 4 bytes and the C++-teams says
"bool" is 1-byte.
And I think it was hard for the C++-team to change the size of bool from
1 to 4 ;-)

Therefor the C++-team has done everything correct...
So for VC8 the C++-team still just set the lower 8-bit of the
EAX-register (called AL).
And the conversion from AL to EAX (1-byte to 4-byte) is done by the
..NET-Framework (mscorwks!PInvokeCalliPostCall).

So the CLR-team has done the conversion...
PS: But for the VC7.1 bug it seems that the C++-team had to solve the
bug (see: http://support.microsoft.com/kb/823071/en-us)

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #4

Jochen Kalmbach [MVP] wrote:
Hi Arnaud! Hello Jochen,

The good question being : where has it been fixed? In the compiler or in the
..NET runtime ;-)


The compiler was not the problem... the problem occured during the
unmanaged-to-managed transition, so it must be fixed in the .NET-Framework.
For the VC7(.1) bug see:
http://www.codeproject.com/buglist/virtualboolbug.asp

I just can remember the reason for this bug: The compiler and the
framework team discussed who should solve the problem (and then they
forgot to solve it :-) )


Yep : that's why I ask the question ;-)
The CLR team said the "bool(ean)" is 4 bytes and the C++-teams says
"bool" is 1-byte.
And I think it was hard for the C++-team to change the size of bool from
1 to 4 ;-)


What is really strange (with framework 1.0 and 1.1) is that, during the
transition return from unmanaged to managed, if the 3 upper bytes of
EAX are !=0, then the framework sets EAX=0x1 (at least, it is how I
have understood the problem...)

Arnaud
MVP - VC

Nov 17 '05 #5
Hi adebaene
What is really strange (with framework 1.0 and 1.1) is that, during the
transition return from unmanaged to managed, if the 3 upper bytes of
EAX are !=0, then the framework sets EAX=0x1 (at least, it is how I
have understood the problem...)


Thats not strange, thats the conversion from "4-byte-value" to
"System::Boolean"...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #6

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

Similar topics

2
by: Alex Vinokur | last post by:
========================================= Windows 2000 CYGWIN_NT-5.0 1.3.22(0.78/3/2) GNU gcc version 3.2 20020927 (prerelease) ========================================= Here is some program...
1
by: A. Saksena | last post by:
Hi all, I am trying to compile following code :- ======================================= #include <iostream.h> #include <string> namespace tlm { template <typename REQUEST, typename RESPONSE >...
7
by: Frank-René Schäfer | last post by:
Case: -- class X has occupies tiny amount of memory: sizeof(X) is only a little greater than sizeof(void*). -- X instantiates thousands of objects and memory does matter. -- The class has...
8
by: Floogle | last post by:
how do i create a virtual == operator. I've tried the following but it's incorrect... class Interface { ... public: virtual bool operator==(const Interface& rhs)const=0;
3
by: Chris | last post by:
I am having a very strange problem involving virtual functions in template classes. First of all, here is an extremely simplified structure of the two classes I am having problems with. ...
1
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...
12
by: mijobee | last post by:
I'm very new to c++ and just writing some code to learn. I've run into a problem, with a javaish design, and want to know if there is any possible solution without modifying the design. I've read...
5
by: druberego | last post by:
I read google and tried to find the solution myself. YES I do know that you can get undefined references if you: a) forget to implement the code for a prototype/header file item, or b) you forget...
11
by: Chris Thomasson | last post by:
Consider an an object that that can has 7 or 8 functions. If you create an abstract base class for the "interface" of the object, well, that means 7 or 8 pure virtual functions right? Well, IMHO,...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

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.