Visual C++ :: Program Run In Another Program

Jul 22, 2014

I want to make a program which can run in another program. My program have structures flowing:

while (1) {
check (keypressed);
{
do something;
}
}

But check(keypressed) function only active in my program, It can't run in another program.

View 7 Replies


ADVERTISEMENT

Visual C++ :: How To Run OpenCV Program

Mar 15, 2013

I am trying to run an OpenCV program from command line, but it gave error like "The program can`t start because opencv_220d.dll is missing from your computer." Try reinstalling the program to fix this problem. I am using Windows 7 & Microsoft VC++ 2010. How can I run the program?

View 4 Replies View Related

Visual C++ :: Creating DLL From Program

Jan 15, 2013

I wanna create a DLL from my C++ program. My output of my C++ program is a text file called Centre_Cartouche.txt My output is two text files called brd.txt and sym.txt

At the beginning my program was just a main which contains all development (Main.cpp). Now I created function (in _Cartouche.h and _Cartouche.cpp).

My debugger tell me that the simulation works. But my file Centre_Cartouche.txt is not create.

_Cartouche.cpp_Cartou.hbrd.txtsym.txt

View 1 Replies View Related

Visual C++ :: Program That Get Data From DAT File

Mar 5, 2014

I am currently writing a program that grabs information from a .dat file. When I go to debut I get this error.

Code:
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
// function step 1 - declare the prototypes
void sort(int n); // catches an integer number from the call
void swap(string *p1, string *p2); //catches the location of data in ram

[Code] .....

View 5 Replies View Related

Visual C++ :: Running GUI Program In Background?

Apr 22, 2013

i created a windows service that will run another program. but the program i want to run has a gui and i don't want the gui to be visible, i just want the program to run in the background.

But i have to do it without editing the gui program

here's my code:

Code:
TCHAR* path = L"C:Myfile est.exe";
STARTUPINFO info = {0};
PROCESS_INFORMATION processInfo;
ZeroMemory( &info, sizeof(info) );
info.cb = sizeof(info);

[code]....

i tested this code with notepad and it runs notepad in the background without displaying the window but when i try run my program it doesn't work. i don't know why its works for one program and not the other..

View 14 Replies View Related

Visual C++ :: Program To Resize Image?

Feb 19, 2013

I am currently working on problem set 4 for Harvard's online CS50 course. I am working on a program that resizes a bmp image by a factor of N. N in entered along with an in-file and out-file in a command line argument. The program needs to calculate the header file for the out-file and write it to the out-file. It then needs to actually resize the image and, again, write to the out-file.

The first question I have relates to the header file, here is my code for calculating the header file:

bi2.biHeight = bi.biHeight *n;
bi2.biWidth = bi.biWidth *n;
int padding = (4 -(bi.biWidth * sizeof(RGBTRIPLE))%4)%4;
bi2.biSizeImage = (bi2.biWidth * sizeof(RGBTRIPLE) + padding) * abs(bi2.biHeight);
bf2.bfSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + bi2.biSizeImage;

And here is my code for writing the new header file (bi2 and bf2) to the out-file:

fwrite(&bf2, sizeof(BITMAPFILEHEADER), 1, outptr);
fwrite(&bi2, sizeof(BITMAPINFOHEADER), 1, outptr);

At this point I need to actually resize the image. As far as I can tell there are 2 ways to go about this you either have to use an array to store each line you want to print repeatedly (and then you can just write it repeatedly) OR you have to move the pointer back in the input stream and repeat the read/resize/write process each time you need to print the row.

It is this that I am stuck on, first of all, I am not sure what system would be better for resizing the image, although I am leaning towards using an array, and regardless, I don't even know where to begin when in implementing either.

So what I am asking for is, first of all, just a "double check" to make sure my header code makes sense. And second of all, a push in the right direction for actually resizing the image. Here is my complete code:

/****************************************************************************
* resize.c
*
* Resizes a BMP piece by piece, just because.
***************************************************************************/

#include
#include
#include "bmp.h"
int main(int argc, char* argv[]) {
// ensure proper usage
if (argc != 4) {
printf("Usage: copy N infile outfile

[Code]....

View 7 Replies View Related

Visual C++ :: DLLS For Installation Program

Aug 27, 2013

I am making an installation program. The set up project I made automatically detected dependencies. Dependencies were one ocx file I am using and some *.msm files. I haven't yet tested the installation program in the target machine.

My problem is that I have no control over the location of dlls installed in the target machine. Those *.msm files, I think
will be installed in the system32 (or wowsystem64?) folder. Do my msi installation program check the version of the dlls
already available in the target machine before overwritting them?

Another way will be to find out the dependencies with "dependency walker" and manually add those dlls to the
application folder of my installation program. But this way will be really difficult one.

View 2 Replies View Related

Visual C++ :: Building A Savings Account Program?

Mar 12, 2014

#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

[Code].....

I need to modify the program to use annual interests rates of 3%, 4%, and 5%.

After that I need to modify the program to make it so the user enters the dollar amount of the deposit, the interest rate or rates, and the number of years.

I'm a design student at New England Tech but before we can go full design they want to make sure we know for sure if we want to be a designer or a programmer and so we need to take C++ classes

View 4 Replies View Related

Visual C++ :: MFC Execute DOS Program And Resume Code At The End

Jun 9, 2013

I have a Third Party MS-DOS program, RUN.EXE

RUN.EXE do the following:

1. Read FILE.INP as input file and run its code execution.
2. When finish, RUN.EXE will produce FILE.OUT as the output of its code execution.
3. However, if calculation made in the code execution come to unsatisfied condition, RUN.EXE will terminate without producing FILE.OUT or partially produce FILE.OUT.

I want to write a program using MFC which I can set a several input case. The program should be able to:

1. Call RUN.EXE.
2. Wait for RUN.EXE to exit.
3. Continue with other code.

I can't modified RUN.EXE. I can't have RUN.EXE callback my program to let know it finish its work.

Are there any functions to call RUN.EXE, a MS-DOS program? Are there any way for the program to check if RUN.EXE finish its work and exited?

View 4 Replies View Related

Visual C++ :: Get Program To Read From File Of 15 Scores?

Dec 10, 2014

I'm trying to get the program to read from a file of 15 scores. 10 are quizzes 5 are exams. I want my program to read from the input file the first name "or" last name and if the user puts a different name, the program Gives off an error screen message

Code:
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;
const int NUM_STUDENTS = 20;
const int NUM_QUIZZES = 10;
const int NUM_EXAMS = 5;

[code]....

View 14 Replies View Related

Visual C++ :: Splitting Child Window In MFC MDI Program?

Dec 4, 2012

how to split a child window in an MFC MDI program.

Splitting Child Window in MFC MDI Program

[URL]

For my purposes, this achievement is practically useless because I cannot find a way to pass text from one CRichEditView window to another.

Given two CRichEditView windows, CInputViewView and COutputView as child windows in an MFC MDI app, my goal is to capture text in the former and print that text in the later using a button click.

Using what appeared to me to be a logical way to proceed, I tried variations of the following code:

Code:
void CMainFrame::DoSomething() {
//MessageBox(_T("Like What ?"), _T("Do Something"));
//CInputViewView * pin = (CInputViewView*) GetActiveView();
CInputViewView * pin = (CInputViewView*)m_wndSplitter.GetPane(0,0);
pin->GetWindowTextW(m_csDisplay);

[Code] ....

None of this works and even the attempt to access the pane results in an app crash in winsplit.cpp.

Code:
#ifdef _DEBUG
void CSplitterWnd::AssertValid() const {
CWnd::AssertValid();
>ASSERT(m_nMaxRows >= 1);
//..

View 4 Replies View Related

Visual C++ :: Converting Program From Struct To Class

Sep 20, 2014

I am not exactly sure how to do this and i keep running into problems. This is my code here that works.

Code:
#include<iostream>
using namespace std;
struct record {
double quiz1;
double quiz2;
double midyear, midyear_one;

[Code] .....

View 5 Replies View Related

Visual C++ :: Creating DLL That Will Be Used As Plugin In External Program Using MFC

Jan 30, 2013

This is the problem in detail:

I have a VC++ project to create a DLL that will be used as a Plug-in in an external programm. This DLL uses some MFC functions. The initial configuration of the project was:

-Use of MFC: Use MFC in a Static Library

-Common Language Runtime support: No Common Language Runtime support

-Runtime Library: Multi-threaded Debug (/MTd)

This configuration worked fine, there were no compilation errors and the resulting DLL worked correctly.

The problem came when it was necessary to add to the DLL some functions of .NET, using the namespace System and similar. To do that, I had to change the Common Language Runtime support, to Common Language Runtime Support (/clr). Then, when I tried to compile, I got this message:

'/MTd' and '/clr' command-line options are incompatible

So I changed the Runtime Library to Multi-threaded Debug DLL (/MDd). Then I got this error message:

Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version

So I also changed the Use of MFC to Use MFC in a Shared DLL.

After this, the compilation was correct. Then logically the size of the generated DLL is smaller, but this new DLL does not work correctly, the external program in which this DLL is used crashes.

I don't know what to do to fix the problem. Maybe I need to add some other DLLs or files to the directory where the DLL is located, where the external program uses it. But I would prefer to include a single DLL file, but this seems to be incompatible with the use of .NET functionality.

View 11 Replies View Related

Visual C++ :: Program That Reformat And Output Date

May 30, 2013

Write a well-commented C++ program that reformats and outputs the date. Prompt the user to input the date in the format dd/mm/yyyy and outputs it in this format month, dd, yyyy. For example, 07/06/2012 is displayed as June 07, 2012. You are provided with the file months.txt containing the months and their corresponding numbers, for example 01January 02February etc. Use getline(monthsFile,monthString) to read in a string from the file, and use the monthString.find() function to search for the number and extract the corresponding month.

-confused by the way she told me to use getline(monthsFile,monthString) => if I just do it like this I only get the first line from the txt file (01January)
-if I try putting all the months on one line in the txt file (which i'm not even sure i'm allowed to do), I'm not sure what to do for the length of my substring output. if I make it long enough to fit longer months like September, someone entering may gets both may and june in the output
-if I input all the months into separate variables, I'm not sure how to make it only output the month entered by the user

the months.txt file is as follows:

01January
02February
03March
04April
05May
06June
07July
08August
09September
10October
11Novmber
12December

View 1 Replies View Related

Visual C++ :: URLDownloadToFile Not Allowing The Program To Return Value

Jun 2, 2013

I've been writing some code and this is part of it:

Code:
...
URLDownloadToFile(NULL, _T("http://something/something.txt"), path, 0, NULL);
return 0;
}

The file gets downloaded successfully but the downloader wont exit (return value 0). So it remains active.

I am sure the problem is URLDownloadToFile()

I am using Visual Studio 2010 Express.

View 6 Replies View Related

Visual C++ :: Program Runs ONLY If Debugger Is Attached

Mar 13, 2014

I have an interesting (and incredibly frustrating) problem where my application runs fine, but ONLY when a debugger is attached to it.

I can build in both Debug or Release and double clicking the execuable causes it to crash before the window is drawn. However if I launch from the IDE (VS2010), again in both Debug or Release mode, the application runs perfectly fine.

How to debug in this situation.

I am using VS2010 in Windows 7, C++ with MFC. This is an application which has been migrated from VC++ 6 to VS2010. Note, it works perfectly when built from VC++ 6.

View 8 Replies View Related

Visual C++ :: Custom Pyramid Drawing Program

Jul 6, 2014

I am trying to figure out how to create a program that will draw a triangle using *'s with a base the has a user-inputted number of *'s like so:

*
***
*****

It needs to take a user inputted number and draw a pyramid like the above pyramid with the number of *'s in the base matching the user inputted number (i.e., user enters 10, so the triangle has 10 *'s in the base). I figured it would be best to first create a loop to draw out the correct number of *'s before trying to create another loop to draw out the correct number of spaces, to properly align the *'s into a triangle shape.

int width = 0;
int height = 0;
int i = 0;
int leafWidth = 0;

[Code] .....

View 7 Replies View Related

Visual C++ :: Program Must Accept 7 Values Or Stop It When Type S

Oct 27, 2014

I want to fix this code. The program must accept 7 values or stop it when you type s. The code not only couts the element, but also some other random numbers.

Code:
#include<iostream>
using namespace std;
int main() {
int numb[7];
int i;
char s;
for (i=0;i<=6;i++)

[Code] .....

View 2 Replies View Related

Visual C++ :: Create A Program That Perform Same Calculation For Every Oscillation

Jan 17, 2014

I am reading from a text file and want to create a program that will perform the same calculation for every oscillation.

The text file I'm reading from is attached to this post. A3.txt

The program that I've written is as follows:

Code:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream inFile ("AP1.txt");
ofstream results_file ("APDuration.txt");

[Code]...

Where I'm having trouble is in having the inFile.seekg function iterate to the next series of values.

Here is what the data file looks like in a graph:

In a nutshell, my program will read the duration of each action potential from a point called "dVmax" (where the upstroke is at its maximum upward rate of change) to the point of 90% repolarization (on the downstroke where 90% of the total wave amplitude is subtracted from the volts at peak amplitude).

If you would like to test my program on one action potential, here is one action potential : AP1.txt

View 8 Replies View Related

Visual C++ :: Program That Take Input From A User And Calculate It In A Do While Loop

May 15, 2013

I'm trying to create a program that will take input from a user and calculate it in a do-while loop. The program does the calculation but the answer is wrong. The loop also doesn't work. The purpose of the program is to see how much an item will cost after a discount is taken off and tax is added.

#include <iostream>
#include <cmath>
using namespace std;
double original_cost;
double discount;
double tax;
double total;
char answer;

[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

Visual C++ :: Program Fails To Show Totals / Averages

May 17, 2014

Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

[Code]....

I know it has to do with the array, and I've tried over and over again to fix my issue and nothing has worked thus far.

View 3 Replies View Related

Visual C++ :: Error In Sending Mails Using SMTP In Program?

Apr 14, 2015

I am working on an application that should send mails to some recipient. I got a mail address tarek@abcd.fr use it to send a mail to tarek@gmail.com. each time I execute my program I got the following message when I send DATA "553, that domain isn't allowed to be relayed thru this mta (#5.7.1) ovh"

I tried to change my port from 25 to 587 (even 465) but I got the same result.

I am using Visual Studio 2010 on Windows 8.

View 2 Replies View Related

Visual C++ :: MFC DLL To Interact With API - Program Crashes After Displaying 100 Bars?

Apr 27, 2013

I have written a MFC dll to interact with an API and it is run by the target program. the first 100 bars are drawn properly but then the program ceases to operate. I am guessing I have a memory leak but I probably just dont understand what I am doing as I am quite new to programming MFC GDI. Here is my code that causes the trouble...

The variables coming in are commented out to facilitate testing and so it would be displaying the same bars over and over because of this. it worrks for 100 bars, then crashes.

void MainDlg::SS_UpdateChart() {
// the chart plot is completely recalculated each time a new bar is shown
// 300 is plottable height
// 400 is plottable width, 39 bars
int displayChartHeight = 300;

[Code] .....

View 11 Replies View Related

Visual C++ :: Payroll Program Is Showing Zero In Output Section

Nov 25, 2013

The program is showing zero in output section ....

Code:
#include <iostream>
#include <cstdio>
#include <fstream>
#include <string>
#include <iomanip>
using namespace std;
const int SZ = 55;

[Code] ....

The output:

Code:
First Last Employee Hours Rate Regular Overtime Gross
Name Name Number Worked of Pay Pay Pay Pay
==============================================================
Jane Adams A1234 40.00 10.00 0.00 0.00 0.00
Mary Lincoln L8765 50.00 10.00 0.00 0.00 0.00
Martha Washington W7654 25.50 10.85 0.00 0.00 0.00
John Adams A9876 52.00 15.75 0.00 0.00 0.00
George Washington W1235 45.00 25.00 0.00 0.00 0.00
Abraham Lincoln L9087 40.25 55.00 0.00 0.00 0.00
William Tell T9876 30.00 9.75 0.00 0.00 0.00

View 12 Replies View Related

Visual C++ :: Transferring Unicode String From One Program To Another With UTF-8 Encoding?

Mar 20, 2015

I'm transferring a unicode string from one program to another with UTF-8 encoding.

Program that is sending:

Code:
// Convert path
std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8_converter;
CString arg = L" /PATH="" + CString(utf8_converter.to_bytes(path).c_str()) + L""";

Program that is retrieving:

Code:
// Restore original path
std::wstring_convert<std::codecvt_utf8<wchar_t>> utf8_converter;
std::wstring path = utf8_converter.from_bytes( argument );

Everything has worked fine, until running on a Japanese edition of Windows.

The "byte path" then looks something like "C:¥Users¥d✝?✝a ,?¥AppData¥Local¥Temp¥file.txt".

"from_bytes()" will throw an std::range_error exception "bad conversion".

The program works fine when working with Japenese writing inside paths in the English edition.

What could be causing the "bad conversion"?

View 10 Replies View Related







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