Wrox Programmer Forums
|
BOOK: Ivor Horton's Beginning Visual C++ 2005
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2005 by Ivor Horton; ISBN: 9780764571978
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 14th, 2006, 04:20 PM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trying to use MVS .NET 2003

On Pg.102 It says to create a new CLR Console Application. MVS .NET 2003 Doesn't have a CLR folder for new projects. All it has is Console Application .NET. When it creates the project everything looks the same besides it doesn't have "array<System::String ^> ^args" in "int main ()". I tried just typing it in but when i compile, it gives me the 4 errors below.


error C2059: syntax error : '>'
error C2065: 'array' : undeclared identifier
error C2275: 'System::String' : illegal use of this type as an expression
error C2447: '{' : missing function header (old-style formal list?)

I've searched A LOT, but no luck. Any help is appreciated.

Here is the code it generates when i created the new project.

Code:
// This is the main project file for VC++ application project 
// generated using an Application Wizard.

#include "stdafx.h"

#using <mscorlib.dll>

using namespace System;

int main()
{
    // TODO: Please replace the sample code below with your own.
    Console::WriteLine(S"Hello World");
    return 0;
}

 
Old July 16th, 2006, 10:19 AM
Authorized User
 
Join Date: May 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not quite sure what you have done.

The process you should be following is:

Select menu item for New Project (under file.)

With New Project window displayed, select 'CLR' under 'Project Types'and 'CLR Console application' under 'templates.'

Type in a project name -e.g. EX2_12; then click the OK button.

A new solution/project should be generated with EX2_12.cpp under the 'Source Files' folder in the Solution Explorer.

The contents of EX2_12 is:
============

// EX2_12.cpp : main project file.

#include "stdafx.h"

using namespace System;

int main(array<System::String ^> ^args)
{
    Console::WriteLine(L"Hello World");
    return 0;
}

=================
Type in your code and, hopefully, there you are...

Hope this helps!


Addition: Just realised that you are using Visual Studio 2003 whereas I am using VS 2005, which is what the book was written around. The above may, therefore, not help you.

Nick
 
Old July 17th, 2006, 08:51 AM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, i do just what you said but like i said their is no "CLR" folder for project types.

The code produced by 2003 and 2005 is the same, excepet for "int main". I dont see why the code would work for 2005 but not 2003.

Thanks.

 
Old July 17th, 2006, 10:57 AM
Authorized User
 
Join Date: May 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry it was not a solution.

Just a thought: You could try the Express version of 2005 -as it is free. It has limitations, which I believe to be with use of MFC, but may get you as far as Chapter 12. (-Guesswork on my part!) (-May get you further as you have MFC 'bits' with 2003.)

http://msdn.microsoft.com/vstudio/ex...c/default.aspx


 
Old July 17th, 2006, 11:26 AM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yeah i think you right on the MFC part for 2005. I guess i'll just have to try that.

Thanks.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion from .Net 2003 to .Net 2005 using VB.Ne coleenh Visual Basic 2005 Basics 0 September 19th, 2006 02:48 PM
Can I run VB .net 2005 with DOT NET 2003 APPLICATI kadesskade BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 2 August 8th, 2006 05:14 AM
Class templates VS.Net 2002 vs. VS.NET 2003 boksi General .NET 4 May 4th, 2005 11:58 AM
ASP.NET 1.1 with VB.NET 2003 chapter 1 subroger Wrox Book Feedback 2 November 11th, 2004 12:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.