Solved

Run external Program

Posted on 1998-04-14
2
1,446 Views
Last Modified: 2013-11-20
Dear
         
       WinExec("cl.exe",SW_SHOWNORMAL);
        I run cl (SDK) program in a MFC program
       When I complie the MFC program, it runs cl        automatically, before linking.
       And it doesn't allow linkng.
     
      What is the program  
0
Comment
Question by:logout
2 Comments
 
LVL 3

Expert Comment

by:byang
ID: 1317737
Let's see if I understand you correctly.

If cl is the compiler, I assume when you compile the MFC program, either you or the IDE will run it, right ? Nothing wrong with that.

Can't link ? What's the error message ?

None of the above has anything to do with how you run cl from within your MFC program, whether you use WinExec() or not.

0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 20 total points
ID: 1317738
>Dear

Dear dear        

>WinExec("cl.exe",SW_SHOWNORMAL);

This looks fine (but for Win95/NT you should really use CreateProcess)

>I run cl (SDK) program in a MFC program

The line above would run the cl.exe program assuming that it is on the program path or current directoy.

Your reference to (SDK) doesn't seem to amke sense, cl is not an SDK program, it is a tool (compiler) that is part of VC.

>When I complie the MFC program, it runs cl automatically, before linking.

Now you're not making sense.  Compiling the MFC program won't run it.  Your WinExec will not happen until you have compiled and linked the program and then run it.

Of course compiling the program will result in cl.exe running because it is the compiler program.  But that is not related to you having the WinExec call in your program source.

>And it doesn't allow linkng.
     
The linker won't run unless you build the entire project, compiling a single source file won't make it link.

>What is the program

Do you want to know the name of the linker program?  It is link.exe

Are you trying to make your own IDE-like environment to compile and link programs?

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question