2

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

Blachshma
  • 17,097
  • 4
  • 58
  • 72
StanOverflow
  • 557
  • 1
  • 5
  • 21
  • I suspect an error elsewhere. – Peter G. Dec 19 '12 at 07:58
  • 3
    Run the code through a static analyser (cppcheck is pretty good, and free), compile with the maximum possible warning level enabled, and fix all warnings/problems. I would imagine you have one or more uninitialised variables somewhere. –  Jan 11 '13 at 12:50

1 Answers1

4

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++)

Vivian De Smedt
  • 1,019
  • 2
  • 16
  • 26