Thread: multiple instances and variables

  1. #1
    Registered User
    Join Date
    Jan 2005

    multiple instances and variables

    When you have several instances of a program running, are the variables insulated from one another, or do they use the same space? So, like if you were to like use static variables to hold values in your winproc, would they disturb one another?

    I have tried some experimenting to determine this, but I think I coded something wrong since my scroll bars worked perfectly, but my static class was disturbed. My lack of knowledge of programming windows was likely the problem, but I am still unsure of the answer.

    Thanks in advance

  2. #2
    uh oh
    Join Date
    Jan 2005
    Ontario, CA
    When running multiple instances your program will have it's own chunk of memory for each instance being run. In no way should they be 'disturbing' each other, unless of course you are running enough of them to cause major backlog in your CPU usage, or if there is low amounts of memory left. However, these would just slow down your computer and would have no effect on each other directly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Best way to avoid using global variables
    By Canadian0469 in forum C++ Programming
    Replies: 7
    Last Post: 12-18-2008, 12:02 PM
  2. Global Variables, include files and classes
    By sharpstones in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2005, 10:06 AM
  3. Replies: 5
    Last Post: 11-19-2002, 07:49 PM
  4. Global variables? Bad! Yes, but to what extent?
    By Boksha in forum C++ Programming
    Replies: 6
    Last Post: 05-26-2002, 04:37 PM
  5. variables in instances of a class
    By alloc(MEM_NEWBIE) in forum C++ Programming
    Replies: 1
    Last Post: 04-08-2002, 01:35 PM