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
ADVERTISEMENT
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
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
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
Jun 28, 2014
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace test {
[Code] ....
I don't know if this is a bug in Winsock or the .NET Framework but i need to fix this or workaround. Recently I was working on a networking class and this error is breaking everything.
If you add Thread.Sleep(1) after Send() call then "TCP Bug detected" doesnt get executed but its not a reliable fix.
View 7 Replies
View Related
Oct 25, 2013
I'm trying to understand winsock with c++. Let's assume I have a 2 working applications, one is the client and one the server:
Client: I can enter a command, for example chat or filetransfer, it will then switch into this specific mode where I can enter commands like uploading a file, send a message etc.
Client
Code: ....
while (rc != SOCKET_ERROR) {
printf("
#");
gets(buf);
if (strcmp(buf, "CHAT") == 0){
// start chat mode
[Code] .....
I'm in a recv/send loop and I'm using streams...so basically all the data is being sent/received there. Now, if I want to upload a file, I send a FILETRANSFER String to the server. Then I will probably need another loop that receives file requests from the client. The server will need more details about the file, like the path, name, size...
Now, my question is, what's the best practise for something like that? I'm having problems understand how I can send 3 different values from the server to the client and how he will receive them in the right order store them in variables. And also, after sending something to the server, in some cases, the client will have to wait for the server to answer.
Is there a good example of a similar application?
View 3 Replies
View Related
Mar 27, 2014
I am trying to make a streambuf for a socket, which will use either WinSock or POSIX sockets depending on OS. I understand about how to send and receive data via sockets, but I don't really understand how to put that into a 'streambuf'. What functions do I need to override?
View 7 Replies
View Related
Jul 28, 2013
when I want to use the same socket connected to the host to send() and recv() for the second time, recv() will return 0 without anything in buffer. Basically I am doing:
1. connect to the website
2. send packets
3. receive packets
4. send packets again (I think this one is working since it's not giving me SOCKET_ERROR)
5. receive packets again (this one is returning 0 so as "connection closed")
source code: [URL] ....
as you can see, I have sock2, which when I use for second send/recv it's working fine, however I will do more communication, and having sockets for all of that and connecting them.
View 4 Replies
View Related
Aug 13, 2014
private void button1_Click(object sender, EventArgs e) {
serialPort1.PortName = "COM1";
serialPort1.BaudRate = 9600;
serialPort1.DataBits = 8;
serialPort1.Parity = Parity.None;
serialPort1.StopBits = StopBits.One;
[Code]...
In my project i have a serialport control and a button, there is no error but i want to know how actually this works, i want to send and recieve the data from the serial port don't know how to do it..
View 9 Replies
View Related
Jan 2, 2014
I have a problem in a c++ project. I have created a .dll file and hooked to an .exe
I want this .dll to make a ping or to send a message like hello somewhere, and IF ping or message doesn't receive an answer that's means the user has suspended-terminated this dll from the exe then the exe will close. How can i do that?
View 11 Replies
View Related
Dec 26, 2014
I have Build code for sending/receiving TCP Traffic over c Socket . Now I want t add HTTP Protocol to it .
After searching out on google ,one method I found which is by GET method to send a query to a server like google.com and request a page .
But ,Suppose I saved a HTML page in my directory how can I send HTTP packet via client/server in socket using this HTML page .
View 4 Replies
View Related
Nov 2, 2013
I'm gonna start a project for my own purpose. In my project I need to access GSM sim cards and send & receive messages through a PC interface. What kind of GSM Interface support for my Requirements and in feature may extend Requirements. what kind of programming language will be simple for write an pc interface to access that GSM interface device.
View 6 Replies
View Related
Dec 27, 2014
I have code for sending/receiving TCP traffic over C socket. Now I want to add HTTP protocol to it. After searching the web, one method I found which is by GET method to send a query to a server like google.com and request a page.
But, suppose I saved a HTML page in my directory how can I send HTTP packet via client/server in socket using this HTML page.
Server side code:
sockfd = socket(AF_INET, SOCK_STREAM, 0);
bind(sockfd, (struct sockaddr *) &serv_addr,sizeof(serv_addr)) < 0)
listen(sockfd,5);
newsockfd = accept(sockfd, (struct sockaddr *)&cli_addr,&clilen);
while (1)
[Code] .....
View 1 Replies
View Related
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
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
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
Sep 11, 2013
My prog name is test and the problem is when i compile it gives error : 'test' is not recognized as an internal or external command,operable program or batch file.
Code:
#include <stdio.h>
#define ISDIGIT(y) ( y >= 48 && y <= 57 )
main( )
}
[code].....
View 14 Replies
View Related
Apr 7, 2013
Is it possible to prompt information from user then display the result in a one dimensional array form? If yes, how should i link them together?
View 7 Replies
View Related
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
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
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
Mar 7, 2014
typedef struct
{
int argument; // userCom arguments
char *arg[MAX_ARGS + 1]; // userCom arguments array
[Code]....
View 4 Replies
View Related
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
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
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
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