Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   dos commands in Visual C++ (http://www.programmingforums.org/showthread.php?t=12642)

irish Feb 22nd, 2007 2:20 PM

dos commands in Visual C++
 
Hey, I'm basically trying this DOS command working:

:

call "AppPath"

in Visual C++ Express Edition. system() won't work and I couldn't find the right command to use for Visual C++.

Anyone know the right command?

Klarre Feb 22nd, 2007 2:50 PM

Why won't it work using Visual Studio? It should. Compiling error?

DaWei Feb 22nd, 2007 4:09 PM

If your path has spaces in it, you'll need more quoting to make "system" work. Detailing the errors would be nice; 'won't work' is a poor bit of information.

pegasus001 Feb 23rd, 2007 10:34 AM

As i recall well i have read somewhere that the express editions of visual studio work only with the clr. U cant make un-managed apps.

Klarre Feb 23rd, 2007 10:45 AM

Quote:

Originally Posted by pegasus001 (Post 124312)
As i recall well i have read somewhere that the express editions of visual studio work only with the clr. U cant make un-managed apps.

That is not true. In Visual Studio Express for C++ you can create unmanaged applications. Don't know how it is in the ones for other languages though...

Eoin Feb 23rd, 2007 10:47 AM

Nope you get the native x86 compiler with VC++ Express. You really need to download the Platform SDK though to get all the needed header and libraries.

Also if you grab the .NET 3.0 Framework SDK you'll get the native x64 compiler and other tools needed to make 64bit application.

[edit] Klarre bet me to it :) [/edit]

pegasus001 Feb 23rd, 2007 10:56 AM

I didnt download the express edition because of that article. Thanx clarre.

jan1024188 Mar 3rd, 2007 4:59 PM

Hi irish

may I suggest you to start using good IDE such Code::Blocks, Anjuta....

:

System("command");
should work fine

milot Mar 3rd, 2007 6:53 PM

In C# .NET that is done by instantiating a System.Diagnostics.Process (read below):

:

  1. using System;
  2. using System.Diagnostics;
  3.  
  4. public class testClass
  5. {
  6.         public static void Main()
  7.         {
  8.                 Process my_proc = new Process();
  9.                 my_proc.EnableRaisingEvents = false;
  10.  
  11.         // this is our command that we want to invoke, in Microsoft Windows we can use "dir" to list our files.
  12.                 my_proc.StartInfo.FileName = "dir";
  13.  
  14.                 my_proc.Start();
  15.                 Console.WriteLine("\nDONE LISTING\n");
  16.         }
  17. }


This must work also in Visual C++ because they are CLS-Compilant languages, and they use same class hierarchy.

Polyphemus_ Mar 4th, 2007 10:06 AM

Quote:

Originally Posted by milot (Post 124725)
This must work also in Visual C++ because they are CLS-Compilant languages, and they use same class hierarchy.

Let me comment on this one. Firstly, Visual C++ is not a language, it is an IDE. You are talking about Managed C++, which is indeed a CLS-compliant language. However, the OP is probably using 'good old C++'.


All times are GMT -5. The time now is 1:56 AM.

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