CLR Console application vs Win32 Console application

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2008
Posts: 11
Reputation: jack1234 is an unknown quantity at this point 
Solved Threads: 0
jack1234 jack1234 is offline Offline
Newbie Poster

CLR Console application vs Win32 Console application

 
0
  #1
Jul 5th, 2008
I am using Visual Studio 2005.

Following two programs has the same code, just that one is CLR Console application and the other is Win32 Console application.

I set a break point at int i=1 for both program, for CLR Console application, and when run to the break point, in the local windows,
I have seen none of the value set for the array beans;but for Win32 Console application, the value has been set correctly.

What is the reason for this different?
====CLR Console application====
  1. #include "stdafx.h"
  2.  
  3. int main(array<System::String ^> ^args)
  4. {
  5. double beans[3][4];
  6. beans[0][0] = 0;
  7. beans[0][1] = 1;
  8. beans[0][2] = 2;
  9. beans[0][3] = 3;
  10. beans[1][0] = 10;
  11. beans[1][1] = 11;
  12. beans[1][2] = 12;
  13. beans[1][3] = 13;
  14. beans[2][0] = 20;
  15. beans[2][1] = 21;
  16. beans[2][2] = 22;
  17. beans[2][3] = 23;
  18. double (*pbeans) [4] =beans;
  19. pbeans++;
  20. int i=1;
  21. }
====CLR Console application End====


===Win32 Console application=====

  1. int main(){
  2. double beans[3][4];
  3. beans[0][0] = 0;
  4. beans[0][1] = 1;
  5. beans[0][2] = 2;
  6. beans[0][3] = 3;
  7. beans[1][0] = 10;
  8. beans[1][1] = 11;
  9. beans[1][2] = 12;
  10. beans[1][3] = 13;
  11. beans[2][0] = 20;
  12. beans[2][1] = 21;
  13. beans[2][2] = 22;
  14. beans[2][3] = 23;
  15. double (*pbeans) [4] =beans;
  16. pbeans++;
  17. int i=1;
  18. }
===Win32 Console application End=====

This is what I see for CLR Console App when debugging
http://tinyurl.com/5jq4yb
This is what I see for Win32 Console App when debugging
http://tinyurl.com/69xzmb

I am using debug configuration, and
is what appeared in Projects>TestCLR Properties>Configuration Properties>Command Line
/Od /D "WIN32" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /FD /EHa /MDd /Yu"stdafx.h" /Fp"Debug\TestCLR.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo /c /Zi /clr /TP /errorReport:prompt /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll"
under Active(Debug) configuration.
Last edited by Ancient Dragon; Jul 5th, 2008 at 8:25 am. Reason: replaced quote with code tags
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,596
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1488
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: CLR Console application vs Win32 Console application

 
0
  #2
Jul 5th, 2008
Maybe its a compiler debugger bug -- I used VC++ 2008 Express and the CLR version displays the values the same way your link shows for the win32 console program.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 11
Reputation: jack1234 is an unknown quantity at this point 
Solved Threads: 0
jack1234 jack1234 is offline Offline
Newbie Poster

Re: CLR Console application vs Win32 Console application

 
0
  #3
Jul 6th, 2008
Hi Ancient Dragon,
I have updated my VS to Service Pack 1, now CLR Application Console looks normal again!
As you have mentioned, the problem may related to VS debugger itself.
Thanks
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 121
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: CLR Console application vs Win32 Console application

 
0
  #4
Oct 19th, 2008
actually i was going to ask the question on title of this thread that is what is the difference between clr console application and win32 console application. how are they different in use etc.
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,596
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1488
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: CLR Console application vs Win32 Console application

 
0
  #5
Oct 19th, 2008
Very briefly, clr is managed, .NET, program. Win32 console is not.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 121
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: CLR Console application vs Win32 Console application

 
0
  #6
Oct 19th, 2008
ok i understand what you mean, can you do the same for windows forms development? can you write unmanaged windows forms development so that it can operate faster?
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,596
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1488
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: CLR Console application vs Win32 Console application

 
0
  #7
Oct 19th, 2008
what makes you think managed code runs faster than unmanaged code? Faster is a relative word -- top speed is not an issue with programs that require human interaction.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC