Visual C++ :: Application That Process Multiple Files Through Command Prompt Call

Dec 22, 2012

I am making an application that processes multiple files (typically > 500) through a command prompt call. The way I start the command prompt app is by looping using a call to CreateProcess for each file that is to be processed. It works fine, except that I somehow loose 'connection' to my app so that

1: Windows says that the app. is 'Not Responding'
2: The Cprogress bar in my app is not updated before all files have been processed, even though there is a CreateProcess call and a Cprogress.StepIt() from the app for each file that needs processing.

I somehow suspect that the CPU gets swamped... I do not want that Windows starts to say that my app is 'not responding' and I want my Cprogress dialog bar to update according to the number of files that are progressed through.

I wonder if multithreading is the OK way to go instead of just kicking of series of CreateProcess calls? Maybe my CreateProcess is not ending correctly? It seems as if my app is 'not regaining control' before very late. The app never crashes though.

My CreateProcess code is listed below, maybe there can be a problem with it, or maybe I should do things in a different way? My app basicaly works as it never crashes, but with above mentioned problems it is NOT a pro solution...

void CMultiFilerDlg::ProcessFile(CString pdfFile) {
int i=0;
DWORD ProcID;
// Open file in text mode:
STARTUPINFO si;
PROCESS_INFORMATION pi;
char cmdArgs[2052];

[Code] .....

View 6 Replies


ADVERTISEMENT

Visual C++ :: Closing MFC Application From Command Prompt

Jul 31, 2013

I have created a MFC dialog based application. Now I want to implement such a functionailty that I will be closing my application through command prompt. And while closing of my application the ExitInstance() method of my application should get called. What is the command which I should put in the command prompt to close my application in such a way.

View 8 Replies View Related

C++ :: Console Application Should Be Like A Command Prompt

Feb 10, 2015

my C++ console application should be like a command prompt. There are "command lines" to execute in the command prompt.Here are my main prompts for spotlight:

Encode - New data entry
View - Read data from text file
Search - Find record from text file
Update - Save changes per text line from the existing text file
Delete - Delete lines from the text file

Now, I manage to do the tasks for Encode, View, and Search..But unfortunately, not in Update..I've been working this for a week already..

#include "stdafx.h"
#include "iostream"
#include "string"
#include "fstream"
using namespace std; //to omit the std
}

[code]....

View 2 Replies View Related

Visual C++ :: Command Prompt - Running GUI Program In Background?

May 2, 2013

No I definitely used Visual Studio Command Prompt

c:Program FilesMicrosoft Visual Studio 9.0VC
un_process_from_service>make.bat

View 7 Replies View Related

C++ :: Execute Command In Command Prompt From Specific Path

Feb 15, 2013

I am facing a problem in C++,I want to execute a command in Command prompt from a specific path.I am able o select a path and execute cmd.exe using the function ShellExecute but the problem is after selecting the path I am not able to execute the command, the command is appearing on another command prompt.

View 4 Replies View Related

C++ :: How To Make Dll And Lib Using G++ Command Prompt

Mar 6, 2015

1. What is dll and lib?

2. How do I make dll and lib using g++ command prompt?

Also, how do I link libraries using g++?

Any good websites that covers my questions,

View 1 Replies View Related

C/C++ :: How To Use Command Prompt In Windows 8.1

Jul 1, 2014

I am studying C How to Program book and want to run GuessNumber Game.

My system command prompt gives C:UsersAcer>_. And GuessNumber path is C:UsersAcercode_examplesGuessNumberWindows.

I am getting below error after pressing enter. How I can run this program.

‘code_examplesch01GuessNumberWindows’ is not recognized as an internal or external command,operable program or batch file.

View 11 Replies View Related

C++ :: Make Program That Has GUI Other Than Command Prompt?

Nov 22, 2013

I am looking to make a program for C++ that has a GUI other than command prompt. The program I am trying to create will ask certain questions and display the results at the end after all questions are asked and have 2 copies of the results one over the other that can be printed as a receipt. Basically I am wondering can I do this using C++. Also I want another GUI other than command prompt as well. Something close to what windows uses if possible.

View 5 Replies View Related

C :: Fixing Command Prompt File Input

Oct 21, 2014

Im writing program for a rail fence cipher that should run from the command prompt and take in two .txt files, one containing the key for how many rails there should be (between 1 and 25) and the other containing the message to be encrypted. Both of those txt files should be entered from the command prompt, taken in with the program's arguments, not asking the user for input I think I have the logistics of how to get the program to encrypt it worked out, but every time I try to run the program it keeps on crashing.

The program should run when I enter this:./railcipher samplekey.txt samplemessage.txt

I'm pretty sure my issue lies within my first few lines of code, with the main(), or with the FILE*, but I dont know what I would need to change it to for it to work properly.

Code:
#include<stdio.h>
#include<string.h>
#include <stdlib.h>
int main(int argc, char **argv[])

[Code]....

View 3 Replies View Related

C++ :: Copy Anything On Already Written Console / Command Prompt?

Oct 22, 2013

i want to know how to copy data from already written text on console?

i am actually making a program that reads texts already printed over console so i want to capture that data again but i must not have a copy version of every thing behind the scenes i.e. in the background. I need to know how to capture data or amount of some data from console output? for example:

[console started]

It's imaginative console for the purpose of understanding.

I will make a very impressive program which will wow! you and to my instructor.
|

[/console ended]

Now i have no copy of any data printed on console/command prompt or whatever you say it. My question is how can i copy following strings from console?

1) It's imaginative console for the purpose of understanding.

2) It's imaginative console for the purpose of understanding.

I will make a very impressive program which will wow! you and to my instructor.

3) very impressive program

4) understanding.

I will make

NOTE: Small bold '|' is my most recent cursor position on cmd.

Moreover in case you need about my IDE,
i am using :
Windows 7 Ultimate Service Pack 1.
Microsoft Visual Studio 2013 Ultimate.
Architecture 64bit.

View 2 Replies View Related

C++ :: Opens New Command Prompt Window For Input?

Oct 8, 2014

If I compile code which uses cin using the command prompt, then run the compiled program a new window opens when it reaches the cin line of code, for the input. If there is no cin used then all printing happens in the original window. Is there a way to stop this behavior of the opening of a new window?

View 1 Replies View Related

C/C++ :: CD Command Not Working Just Keeps Showing Opening Prompt

Mar 7, 2014

typedef struct
{
int argument; // userCom arguments
char *arg[MAX_ARGS + 1]; // userCom arguments array

[Code]....

View 4 Replies View Related

C++ :: Clearing Text Off Of The Command Prompt Screen

Mar 5, 2013

I am having a problem with my c++ code. I am attempting to clear the text off of the command prompt screen in a text based game program. I put a restart option using a goto in my program. How would I be able to clear all previously displayed text.

View 7 Replies View Related

C/C++ :: Command Prompt Window Disappears Before Output?

Jan 14, 2013

this is my program, it works fine when asking for inputs, but as soon as i press enter for the output the window just dissapers.

#include<stdio.h>
main()
{int bno;

[Code].....

View 2 Replies View Related

C++ :: Command Prompt Will Not Disappear After Input Names?

Nov 12, 2014

Here is a code snippet which is a bit annoying.

Code:
cout << "Put in the names of people, press q to exit" << '
';
while((cin >> people_inp) && (people_inp != "q")){
Person *p = newPerson(people_inp);

[Code] ....

The problem of this code is when you put in the names(via cin) and press enter command prompt will disappear. What should I do so that Command prompt will not disappear after I input some names? I mean it disappears without you pressing a key.

View 14 Replies View Related

C :: Send Information And Receive From External Command Prompt From Program?

Jan 10, 2014

How can I send information and receive from external command prompt from my program??. I want to run an external command prompt, a code that's is not mine, to send information to this command prompt, then make my program hit enter at the command prompt and then receive back information from the command prompt.

View 5 Replies View Related

C# :: Command To Attach A Macro On A Process?

Jan 20, 2014

i would like to know if its possible to use a c# command to attach a macro ( JitBix MacroRecorder ) so it would send keystrokes while the process/program was minimized. i've tried with [lapeiro, on 20 January 2014 - 06:43 AM, said: i would like to know if its possible to use a c# command to attach a macro ( JitBix MacroRecorder ) so it would send keystrokes while the process/program was minimized.

View 4 Replies View Related

C :: Best Process For Cross Compiling Application

Oct 26, 2013

I'm creating a small command line game in C. I have never done anything cross platforms, but this is small enough (so far) that it might not be too bad.

When I am done, I'm not sure how it will be distributed: Either I will just send people the C files and say "compile on your system with these options", or I will just have executables for various systems. Probably Windows 7/8, Ubuntu, CentOS, and whatever I can find to test on.

I right now I'm testing/developing on Windows 7 using MinGW. So my questions are: while I'm developing, how should I be compiling/testing it?

View 4 Replies View Related

C/C++ :: System Call A Command From Within A Program?

Sep 17, 2014

how to invoke a UNIX command within a program

I found this:

dd if=/dev/urandom of=myrandom bs=100 count=1

and I found this:

dd if=/dev/zero of=mytestfile.out bs=1 count=0 seek=1G

I want to call this command, by using the command line and typing Generate or something to that effect.

Basically, I want to be able to build random size files, content isn't important to me at this time.

View 8 Replies View Related

C++ :: Reads Process And Return Values From It - Application Crashes Because Of Buffer Size

Nov 11, 2014

I have an application that reads a process and return values from it. The problem it works fine with small processes but i have some processes that are about 1GB or even 2GB and when i try to read such big processes the application crashes. I'm trying to find a way to read the process memory in chunks of maximum 10 MB. The read code looks like:

Code:
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, entry.th32ProcessID);
unsigned char *p = NULL;
MEMORY_BASIC_INFORMATION info;
for (p = NULL; VirtualQueryEx(hProcess, p, &info, sizeof(info)) == sizeof(info); p += info.RegionSize)

[Code] ....

This reads the info.regionsize which can be as large as 100 MB. Is there any way to read it in chunks ?

View 12 Replies View Related

C++ :: Maintain Variable Between Multiple Process

Mar 9, 2013

In the existing code,fork has call parallel to create process.my job is to store all the process id into vector so that we can verify the status of the jobs. I was able to save all the jobs but as the callback happen so I have lost my all value which was store into vector.

How can i maintain variable between multiple process.

View 1 Replies View Related

C++ :: Display Last 1000 Lines From Multiple Text Files (log Files)

Jan 16, 2014

I am writing a piece of code that requires me to display the last 1000 lines from a multiple text files (log files). FYI, I am running on Linux and using g++.

I have a log file from which - if it contains more than 1000 lines, I need to display the last 1000 lines. However, the log file could get rotated. So, in case where the current log file contains less than 1000 lines, I have to go to older log file and display the remaining. For e.g., if log got rotated and new log file contains 20 lines, I have to display the 980 lines from old log file + 20 from current log files.

What is the best way to do this? Even an outline algorithm will work.

View 6 Replies View Related

C++ :: Parsing Command Line Arguments And Function Call Queue

Jun 12, 2014

I am trying to create program which will process command line arguments and define which functions should be run, with specific order and specific arguments. This is my first problem:

Code:
// proccessing_args.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <vector>
#include <string>
#include <iostream>
#include <conio.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])

[Code] ....

proccessing_argsproccessing_args.cpp(20): error C2143: syntax error : missing ',' before ':'

refers to the line with for. I copied the code form here [URL] .....

View 14 Replies View Related

C/C++ :: TCP Server / Multiple Client With Select Process And Forking

Sep 12, 2014

I have created a Server that can handle multiple users with the select function. The server seems to be operating just fine on every new request of a client even on the case of termination connection. The problem appears on the client side. I am applying forking process to be able to hear and write at the same time while the user is typing a message to the rest of the clients. By doing so I discovered that when the client is initialized it send a blank message to the server. The server then send this blank message to all the clients. I have discovered a "trick" not to display the message on the client side but I really would like to know if there is an alternative solution instead of my solution. I mean why it dose not wait for the client to first start typing a message before to send it.

The communication that will apply on each new connection is:

Client Server
Connect() −− >
< −− Hello version
NICK nick −− >
< −− OK/ERROR text
MSG text −− >
< −− MSG nick text/ERROR text

Sample of the Server.c code:

#include <stdio.h> /* stderr, stdout */
#include <errno.h> /* errno.h - system error numbers */
#include <stdlib.h> /* memory allocation, process control etc. */

[code].....

View 6 Replies View Related

C++ ::  Multiple Files Causes (Multiple Definition) Error?

Jul 15, 2013

I'm using multiple C++ files in one project for the first time. Both have need to include a protected (#ifndef) header file. However, when I do that, I get a multiple definition error.

From what I found from research, adding the word inline before the function fixes the error. Is this the right way to do this, and why does it work? Should I make a habbit of just declaring any function that might be used in two .cpp files as inline?

View 5 Replies View Related

C++ :: Call External Application In Program?

Oct 27, 2014

I am trying to call an external application in my C++ program , example, system("C:Program FilesInternet Exploreriexplore.exe"); but the application just gets closed.

1. double slashes need to be used.
2. the command that worked for me was "ShellExecuteEx"

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved