Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,545 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,561 people online right now. Registration is fast and FREE... Join Now!




How to add *.exe in run program

 
Reply to this topicStart new topic

How to add *.exe in run program

doubts
22 Nov, 2007 - 10:23 PM
Post #1

New D.I.C Head
*

Joined: 1 Nov, 2007
Posts: 17


My Contributions
hi all... i've used the following coding for the program... now i want to use *.exe so that i can get the window for which ever .exe function i typed::

CODE
void CDay2Dlg::OnRunpgm()
{
    // TODO: Add your control notification handler code here
    ///////////////////////
     // MY CODE STARTS HERE
     ///////////////////////

     // Get the current values from the screen
     UpdateData(TRUE);

     // Declare a local variable for holding the program name
     CString strPgmName;

     // Copy the program name to the local variable
     strPgmName = m_strProgToRun;

   // Make the program name all uppercase
    strPgmName.MakeUpper();

     // Did the user select to run the Paint program?
    if (strPgmName == "PAINT")
         WinExec("mspaint.exe", SW_SHOW);

    
  if (strPgmName == "NOTEPAD")
         WinExec("notepad.exe", SW_SHOW);

    
     if (strPgmName == "SOLITAIRE")
         WinExec("sol.exe", SW_SHOW);


    
}

User is offlineProfile CardPM
+Quote Post

oXiDe
RE: How To Add *.exe In Run Program
22 Nov, 2007 - 10:33 PM
Post #2

New D.I.C Head
*

Joined: 17 Nov, 2007
Posts: 37



Thanked: 1 times
My Contributions
this looks like C .. or C++ w/e .. if im not mistaken
User is offlineProfile CardPM
+Quote Post

doubts
RE: How To Add *.exe In Run Program
22 Nov, 2007 - 10:35 PM
Post #3

New D.I.C Head
*

Joined: 1 Nov, 2007
Posts: 17


My Contributions
QUOTE(oXiDe @ 22 Nov, 2007 - 11:33 PM) *

this looks like C .. or C++ w/e .. if im not mistaken

this is the starting of vc++ which is quite similar to c++
User is offlineProfile CardPM
+Quote Post

kwikone
RE: How To Add *.exe In Run Program
24 Nov, 2007 - 11:00 AM
Post #4

New D.I.C Head
Group Icon

Joined: 25 Oct, 2007
Posts: 10


Dream Kudos: 25
My Contributions
QUOTE(doubts @ 23 Nov, 2007 - 01:35 AM) *

QUOTE(oXiDe @ 22 Nov, 2007 - 11:33 PM) *

this looks like C .. or C++ w/e .. if im not mistaken

this is the starting of vc++ which is quite similar to c++

In which case this is posted in the wrong forum and should be in the C, C++ forum
User is offlineProfile CardPM
+Quote Post

NickDMax
RE: How To Add *.exe In Run Program
25 Nov, 2007 - 01:50 PM
Post #5

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,868



Thanked: 53 times
Dream Kudos: 550
My Contributions
QUOTE
now i want to use *.exe
I'm sorry I don't understand what this is supposed to mean.

You already seem to know how to use: WinExec(program_name, SW_SHOW);

have the user type in a name, store the name in a string, and then pass it to WinExec... tada

QUOTE
this is the starting of vc++ which is quite similar to c++
Well VC++ is C++... it does have a set of classes known as STI which allow you to write "managed C++" programs, and since the STI libraries overload a bunch of operators (which really changes the feel of the language) it does not seem like C++, but it still is. -- Though to be fair, Microsoft always adds their own twists so maybe it is fair to call it "similar to c++".

But there is nothing in that code snippet that is unique to VC++
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/7/09 09:29PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month