Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 25th, 2005, 4:04 PM   #1
Gradius
Newbie
 
Join Date: Nov 2004
Posts: 10
Rep Power: 0 Gradius is on a distinguished road
Creating .NET applications using visual c++ express.

Now i did do alot of reading and googling but i cant seem to find anything. Microsoft says you can but they dont tell you how. Anybody care to explain what i should do.
Gradius is offline   Reply With Quote
Old Nov 25th, 2005, 5:22 PM   #2
George Giolfan
Newbie
 
Join Date: Aug 2005
Location: Romania
Posts: 13
Rep Power: 0 George Giolfan is on a distinguished road
I think they are named CLR projects.
George Giolfan is offline   Reply With Quote
Old Nov 25th, 2005, 7:05 PM   #3
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
Maybe i'm missing something but if you have Visual Studio 2003 .NET, go to File-->New-->Project. When the dialog box pops up, choose Visual C++ projects to the left and Empty Project (.NET) to the right.

EDIT: I see that you're using VC++ Express. Nevermind.
OpenLoop is offline   Reply With Quote
Old Nov 25th, 2005, 7:20 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
File | New | Project.
Under "Visual C++", click CLR.
There are a number of templates to select from, I chose "CLR Console Application".
I then chose the Name:, "Experiment", and clicked "OK". This is what I got:
// Experiment.cpp : main project file.

#include "stdafx.h"

using namespace System;

int main(array<System::String ^> ^args)
{
    Console::WriteLine(L"Hello World");
    return 0;
}
I then clicked the "Build Solution" icon. One can use Ctrl-Shift-B, or the menu, Build | Build Solution.

I then moved "Experiment.exe" from C:\Documents and Settings\David\My Documents\Visual Studio\Projects\Experiment\debug to the desktop, opened a command prompt, changed directories to the desktop, and entered the command, Experiment What you see below is what I got.
Quote:
Originally Posted by Output
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\David>cd desktop

C:\Documents and Settings\David\Desktop>experiment
Hello World

C:\Documents and Settings\David\Desktop>
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 25th, 2005, 8:07 PM   #5
Gradius
Newbie
 
Join Date: Nov 2004
Posts: 10
Rep Power: 0 Gradius is on a distinguished road
Heres the error that im getting. Do i need to update .NET platform or download a new compiler. Because im using VC++ Beta2.
------ Build started: Project: Experiment, Configuration: Debug Win32 ------
Compiling...
stdafx.cpp
.\stdafx.cpp : warning C4379: Version 2.0.50727.42 of the common language runtime is not supported by this compiler. Using this version may cause unexpected results
predefined C++ types (compiler internal)(12) : fatal error C1205: Generics are not supported by the version of the runtime installed
Build log was saved at "file://c:\My Documents\Visual Studio 2005\Projects\Experiment\Experiment\Debug\BuildLog.htm"
Experiment - 1 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Gradius is offline   Reply With Quote
Old Nov 25th, 2005, 8:33 PM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Beta 2 is precisely what I used. Maybe you need a net framework update. That's what the error message seems to imply, anyway. May as well download the latest version of the compiler, too. It's free.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 25th, 2005, 9:49 PM   #7
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
i can update my vc++ compiler?
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Nov 25th, 2005, 9:59 PM   #8
Gradius
Newbie
 
Join Date: Nov 2004
Posts: 10
Rep Power: 0 Gradius is on a distinguished road
Yay it works. All i really wanted out of this was to make a simple gui. Should i stick with this or just learn MFC?
And now this code isnt working.
#include "stdafx.h"

using System;
using System.Windows.Forms;

 

class App{

   public static void Main(){

      Application.Run(new SomeForm());

   }

}

 

class SomeForm:Form{

   public SomeForm(){

      Button button = new Button();

      button.Text = "My Button";

      button.Click += new EventHandler(OnClick);

 

      this.Controls.Add(button);

      this.FormBorderStyle = FormBorderStyle.Fixed3D;

   }

 

   void OnClick(Object sender, EventArgs args){

      MessageBox.Show("The Button Was Clicked!");

   }

}

Quote:
i can update my vc++ compiler?
Yeah. Its free.

Last edited by Gradius; Nov 25th, 2005 at 10:21 PM.
Gradius is offline   Reply With Quote
Old Nov 26th, 2005, 8:28 AM   #9
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
The secret to getting good help is the same as the secret to debugging -- information. "This code isn't working" doesn't really hack it. You're asking for people to take time to analyze your code AND your mind. Maybe someone will guess at what it's supposed to do and figure out why it isn't.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:32 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC