StanOverflow
StanOverflow

Reputation: 567

Program behaves differently running outside Visual Studio

I have a program that draws Mandelbrot and Julia sets, displaying them with OpenCV(in separate windows), it runs correctly inside Visual Studio, but when I run the .exe outside visual studio one of the windows doesn't zoom properly.

The window displaying the Mandelbrot set draws and zooms correctly, the other window, using the exact same zoom method (that works when running inside Visual Studio) doesn't work

case CV_EVENT_LBUTTONDOWN:
    zx_point += x*zinc;
    zy_point -= y*zinc;
    zinc *= zoom_safe;
    zx_point -= x*zinc;
    zy_point += y*zinc;
    Draw(ptr_kernel, ptr_queue, ptr_image, ptr_context);
break;

It seems like "zx_point" and "zy_point" aren't being written to, since the window zooms into the top left corner no matter where I click.

In short, debug/release work inside visual studio, have the same strange behavior outside. The dlls are in the same folder as the .exe the output window shows those same dlls loading in VS2010

What might cause such strange behavior?

Thanks

Upvotes: 2

Views: 1046

Answers (1)

Vivian De Smedt
Vivian De Smedt

Reputation: 1029

The differences between running a program within Visual Studio and outside visual studio are:

  1. The arguments that are passed to the program.

  2. The working directory of the application.

  3. The environment variables if you changed them after you started Visual Studio (or after you started the launcher if you use such launcher: e.g.: Explorer++)

Upvotes: 4

Related Questions