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
ADVERTISEMENT
Nov 3, 2013
Visual studio 2012
I have a project that has a few .asm files (assembly language code), I have the compiler/assembler set to create a list file for the assembly code and would like the debugger to use the .lst file for the source instead of the .asm files because in the .asm files the macros are not expanded like they are in the .lst files which makes debugging difficult sometimes.
View 1 Replies
View Related
Mar 6, 2015
I'va create a c program that scans the web from a root it works on mypc but dont works on another pc of my friend.I have created this project with Visual Studio 2013 disabling extension to obtain standard ansi c project.
View 2 Replies
View Related
Feb 8, 2013
I'm digging an old project and i can't switch to a newer visual studio.
I want to plot float data array during debug.
I know some IDE's have such option. There is a separate window in which we can plot data.
Can I write such plugin for Visual Studio 6.0 using visual studio SDK?
Does it support 6.0 version?
View 1 Replies
View Related
May 23, 2013
Visual c++ 2010 Express
Somehow the watch window is no longer shown in the debugger. It used to be available and I am stopped at a breakpoint.
Is there a way to turn it back on or restore it?
View 4 Replies
View Related
Oct 15, 2013
Program compiles and runs no problem but closes right away when finished.
Heres the code:
Code: #include <iostream>
#include <cmath>
using namespace std;
double calcDistance(double,double, double, double);
float calcKilometers(float, const float) ;
[Code] ....
View 3 Replies
View Related
May 16, 2014
The code is supposed to display the total and averages of the data as well, but cuts off due to an error in the code. The code should also:
1)Print checks for all employees, one per page, sorted by lastname. The first check number, 100, is to be read from a company data file (see requirement 4). The border of each check is important and should not be omitted.
2)Convert the net pay to a text string for each check printed.
3)Print a reference code on each check. The reference code is obtained by combining the first letter of the lastname with all the consonants remaining after removing all vowels (a,e,i,o,u).
4)Use the same employee data found in assignment 2. Use company data, obtained from a text file, for each check printed:
Spoiler
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
typedef short BOOLEAN;
typedef char STR15[15 + 1];
typedef char STR10[10 + 1];
typedef struct PayRecord
[Code] .....
View 14 Replies
View Related
Apr 20, 2014
I want to create a welcome text header during the program runs. I wanna keep it at the top while the program is running (like asking for input@ showing output).
EG:
-----
WELCOME
----- //Stay until end of the program
// output/input. "WELCOME" stay at the top
View 2 Replies
View Related
Mar 24, 2014
I have an assignment to write a program that will calculate the number of days between two dates (including leap years). We have to read the data from a file and in my current input file I have:
1 1 2000 1 5 2004
5 2 2005 2 5 2009
1 15 1998 1 15 2001
for testing purposes. When I run the program the console runs continuously spouting out "The days between your two dates are 1097." Which would be the correct output for the last set of dates entered, but I need to find out where I've messed up in my main.
#include <iostream>
#include <fstream>
using namespace std;
bool isLeap(int x) {
if (x % 400 == 0) {
[Code] .....
View 7 Replies
View Related
Oct 21, 2013
My question is why when I attach this function to an object, it produces a different result? If I attach div() to goose, it produces 4 as the value of alpha, but if it's not attached, it produces 3, why is this?
main.cpp
#include <iostream>
#include <cstdlib>
#include "main.h"
using namespace std;
int main() {
Oreo fox;
[code].....
View 5 Replies
View Related
Jul 21, 2013
I use SmtpClient's SendAsync method,when after send mail, i delete the file ,tip The process cannot access the file because it is being used by another process.
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
SmtpClient client = new SmtpClient();
string attachmentPath="c:\test.jpg"
if(attachmentPath != "") {
[Code] .....
View 4 Replies
View Related
Sep 2, 2013
Current compiler doesn't have correctly defined debugger!
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
Create new parser for project 'Test'
Project 'Test' parsing stage done!
View 4 Replies
View Related
May 11, 2014
How can i look into the element that are pushed into the list. Something like listPointer[0].heapPointer,50
class CA{
public:
CA(void);
[Code].....
View 3 Replies
View Related
May 19, 2014
found out that I had to split my project in two programs (console projects).
I wanna make sure in the main program that the logger runs and if I can, have the main program do commands within the console.
Now how can I do this? is it a header that I have to include? is it a built in feature of c++?
View 7 Replies
View Related
Sep 19, 2014
I used a heap viewer to check for memory leaks. I have many of them and its hard to find out where it is not being freed. Is their a way to use the debugger to log the addresses of the data it allocated on the heap. This way I can trace it back. Or is their any other way to fix memory leaks properly.
View 4 Replies
View Related
Aug 4, 2013
So, I have this code:
...
MakeTexture((char*)ilGetData(), ilGetInteger(IL_IMAGE_WIDTH), ilGetInteger(IL_IMAGE_HEIGHT));
...
And it compiles fine and, supposedly, works fine too, but when I try to put a break point inside the MakeTexture fuction gdb just goes crazy, it freezes and starts alocating memory until it reaches like 30+ mbs, and after that codeblocks freezes and I have to terminate the gdb process to return everything back to normal.
Now, another weird thing is that this only happens if I pass (char*)ilGetData(), if I pass something like NULL to the function, this doesn't happen.
Oh, also, the MakeTexture function is this:
int MakeTexture(char *pxData, unsigned w, unsigned h)
{
return 0;
}
View 2 Replies
View Related
Nov 26, 2014
I am trying to write a function to save the state of a tic tac toe game. It seems to be working well except the loop to read the chars in from a .txt file is running 18 times instead of 9 and thus overwriting the array with blank boxes. The code below is the part of the function I am having an issue with. Counter is being increased every time the second for loop runs which should be 9 times. However, it is apparently running 18 times with the first 9 runs filling newBoard correctly and the second 9 times overwriting it with boxes. how to fix it?
ifstream inputFile("file.txt");
char newBoard[3][3];
char a;
int counter = 0;
while(counter<=9) {
for(int r = 0; r<3; r++)
[code]...
View 2 Replies
View Related
Jun 10, 2014
I have an code that makes form window + button bet bigger when pressed each time, but it runs endless till out of screen,
code:
{
int S1 = 300;
int S2 = 0;
[Code]...
make it so it runs only each time i press the button?
View 2 Replies
View Related
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
View Related
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
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
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
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
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
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
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