I am writing a small editor for RSL coding, and ive got an external program "3Delight" to compile the code.
Now i want the output from that exe to be captured in a string once the compilation is comlete, but all of the methods ive found online dont seem to work for me. Ive tried using _popen which works if i run a normal command like "dir", but not with the exe.
This is the function ive been using that works with the normal commands
std::string exec(const char* cmd) {
FILE* pipe = _popen(cmd, "r");
if (!pipe) return "ERROR";
char buffer[128];
std::string result = "";
[Code] .....
and this is how i was calling it, but it just returned an empty string, even though the exe printed "Compilation successful"
write a program that prompts the user to input a string and outputs the string in uppercase letters. (Use a character array to store the string.) Does this follow the criteria? This program is very similar to one I found on these forums but I have one problem, it outputs everything backwards! EX: dogs will output to SGOD. What I need to do to make it output correctly, I think it may have to do with getline?
#include <iostream> #include <cctype> #include <cstring> using namespace std; int main() { char let[100]; cout << "Enter what you would like to be UPPERCASE: ";
I want program to make bitmap from my Window. I also want to do add some additional steps which I will try to add later. But now I want to ask you how to fix the code. For some reason when I debug the code (break on line 73 of capture.cpp) there the pointer pBitmap is 0x00000000 . So how to correct the code to successfully capture Window? Here I give the complete codes:
stdafx.h
Code: #pragma once #include "targetver.h" #include <stdio.h>
[Code].....
Feel free to set correct name of Window on line 17 for FindWindow() function.
PS: The code is remake of script to capture screen, which saved the bitmap to file. This is not what I want because I would be content if I could send (or maybe share!) the bitmap to ahk script which will ask my C++ program for the bitmap.
I was creating a template and I realized that certain data-types/structs/classes would not be applicable to my template.This would cause bugs and errors if used incorrectly. Is there a way to restrict a template-capture to certain types/classes?
I sent 1preample and 4bytes in transmitting side , preample contains only 1 and 0 with 4milliseconds delay, each byte contains 8bits with 2milliseconds delay , if a bit contains 1 it will send 1millisecond high and 1millisecond low signal ,and if a bit contains 0 it will send 2millisecond continuous delay, I have a problem at receiving side how to capture and store the preample and 4byte values in a buffer , i am using ARM processor it will update every 5microsecond ..
For a ribbon bar with edit controls (CMFCRibbonEdit) I want to handle the mouse scroll events for the edit controls. That is, when the user clicks and then scrolls on the edit it will navigate a predefined list of strings. I want to capture the scroll event in order to update the edit text step by step.
This kind of behavior is implemented by the Spin Edit; I don't want to use the spin edit control since it only uses a list of integers and the spin buttons are too small.
Is there a way to catch the mouse scroll event for the CMFCRibbonEdit control? How to approach message handling for the ribbon (other messages than the COMMAND allowed by the ribbon designer). I'm using VS2010 on Windows 7 and the ribbon was designed with the ribbon designer?
I am working on a project in which we capture a video using DirectShow samples. I want to know whether it is possible to capture a video with No noise, No interference etc. in other words, we want to capture High Quality (HD) video using DirectShow.
Is there any sample defined in DirectShow using which we can capture HD video.
How to capture incoming serial data and store it into an array for controlling functions. But I am now working with a radio module that receives incoming data and stores it into a uint_8t.
From there in the basic sketch that the radio library came with it is printed in the serial terminal like this:
uint8_t buf[RF22_MAX_MESSAGE_LEN]; uint8_t len = sizeof(buf); if (rf22.waitAvailableTimeout(500)) { // Should be a message for us now if (rf22.recv(buf, &len)) { Serial.print("got reply: "); Serial.println((char*)buf);
I have read a lot of tutorials on pointers, and I am just having a very hard time grasping how to extract data out of one. I realize this is char and not integers. The goal is to transmit five integers in a digital state of either 1 or 0, and then store them in the receiving side and control 5 outputs based on the status of those 5 bits. This is proving to be quite confusing for me though as I cannot seem to grasp how to control the pointer logic.
I want to process data (using fstream) and print out the progress. This doesn't work with cout <<, only with puts, but this causes a line-break but I want a progress bar like this : [=====================].
I've already searched for an hour in the reference and with google and I dont manage to put a string without a linebreak:
while (ein.good()) // loop while extraction from file is possible { c = ein.get(); // get character from file if (ein.good()){
I have a program that will convert a string of numbers into a barcode that consists of :'s and |'s. But the only issue I have is that the numbers are all being output backwards.
I'm trying to write a simple program that will prompt for a string typed in by keyboard and save it to a file. I've tried lots of variations and this is just the latest version.
//Prompt for a string input by keyboard and save it to a file
#include<iostream> #include<fstream> #include <string using namespace std;
I have been trying to get this my class template to print out a string for me, however I am getting :
" error C679 ' No operator found which takes a right hand operand of type std:: string' "
I have tried various way to get this going however I cant get past this error. I understand that templates functions how ever i am not sure why i am not getting my string to be displayed.
#include <iostream> #include <string.h> using namespace std; template<class T> class BinaryTree { struct Node {
I'm reading in a string from the command line into a char array followed by a series of ints which are read into an int array.
The command line
Code: lab3 word word word 0 0 2 3 results in the following output:
Code: Word: .N=▒ Number of Words: 0 Word: .N=▒word word word Number of Words: 3 Num: 0 Num: 0 Num: 2 Num: 3
Here is the source code:
int main(int argc, char *argv[]){ if(argc < 2){ //command line must have at least three arguments (one //char, one integer) printf("Error: invalid number of arguments
So basically here I have a menu in my C program and if I were to select option 2, I would enter a string up to 30 characters and it would output each block of 16 bytes should be shown which contains a character in the requested string. However, when I compile and run the program and search for the string, nothing happens. what I may be doing wrong?
Code:
else if (select == 2){ printf("Enter a string of up to 30 characters: "); scanf("%s", &userstr); //Compares both user's string and file string for (i = 0; i < size; i++){ if (strcmp (buffer, userstr) !=0){
I am writing a code in a class that will change the user input which is integer to a string. For example if the user enter 13347..the output should change to "one three three four seven" on the user screen.I'm not getting the right output.
Code below:
#include <iostream> #include <string> using namespace std; string arr[]={"one","two","three","four","five","six","seven","eight","nine"}; class convertTo{ public: int signed num; int convet(){ cout<<"Enter a number to convert to string "; cin>>num;
I am writing a code in a class that will change the user input which is integer to a string. For example if the user enter 13347..the output should change to "one three three four seven" on the user screen.I'm not getting the right output.
Code below.
#include <iostream> #include <string> using namespace std; string arr[]={"one","two","three","four","five","six","seven","eight","nine"}; class convertTo{ public: int signed num;
I'm trying to get this programme to work but I can't get it to output the string data at the end of the line.I have copied and pasted the line in question below but it may be a prob with the prog further down.
It reads character input ok but doesn't put one string into another or recognize when a string is quoted in a printf.
Code: printf("%s what is your second name? ", surname, name2, name); #include <stdio.h> int main () { char name[20];