Results 1 to 6 of 6

Thread: Console Window flashes on and off while running C++

  1. #1
    Join Date
    Aug 2006
    Posts
    142

    Console Window flashes on and off while running C++

    Hi friends,
    I am very new to the C++ programming language. I am facing very strange problem. When I tried to search in Google, I can't find the appropriate solutions. So thought posting here will prove helpful for me. My problem is when I try to run the basic C++ program, the Console Window flashes on and off. I have written the proper code because the same code was working on my friends system. Also I tried to copy and paste the codes from the getting started with C++ sites. But the same problem is persisting. Please help me to sort out my problem.!!
    ~HARE KRISHNA HARE RAM~

  2. #2
    Join Date
    Mar 2008
    Posts
    349

    Re: Console Window flashes on and off while running C++

    The console window flashes on and off, mainly when you are not using the method that isn't calling from the command line and you are using the command line program. I think that same thing is happening in your case also. Your window is flashing on and off because it is a command line program and you aren't calling it from the command line program. I would like to suggest you to go first to command line and then try calling the program. If there is any output/error messages, it will be shown to you. Hope that using the command line will fix your issue.

  3. #3
    Join Date
    Mar 2008
    Posts
    672

    Re: Console Window flashes on and off while running C++

    Have you done the settings in the Environment Variables?? Because the problem can occur if you haven't set the Environment Variables properly. According to the Microsoft "Environment variables are strings that contain information such as drive, path, or file name. They control the behavior of various programs. For example, the TEMP environment variable specifies the location in which programs place temporary files". You will have to set the path for the Environment variables. The path to a file is basically its address on the computer. It tells programs how to find a file. It is the drive plus any directories and sub-directories where the file is located. The %PATH% environment variable specifies the command search path. I think that setting the proper path will resolve your issue.

  4. #4
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Console Window flashes on and off while running C++

    You can set the Environment Variable by following the steps given below :
    1. Right click on the "My Computer" icon placed on the desktop.
    2. Then select the Properties option.
    3. In properties option, select the Advanced tab.
    4. After clicking on Advanced tab, a dialog box will appear.
    5. Then click on the button "Environment Variables".
    6. To create a new variable, use the "New" button. There are also buttons for editing and for deleting variables.
    7. The box for adding a new user variable will appear.
    8. Box for editing a variable; in this case it is the PATH variable. Be sure to remember to separate directory names with a semicolon.
    9. Browse the path of the desired directory and then Add the path.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Console Window flashes on and off while running C++

    You can also add the folder using the add-on tool Setx.exe. This specific application is not the part of the standard Windows XP setup, but it is a command-line tool called setx.exe that is included in the Windows XP Service Pack 2 Support Tools. You can make the permanent changes in the environment variables by using this tool. You can add the New Folder which is located in C: drive by using the following command :
    setx path "%PATH%;C:\New Folder"

  6. #6
    Join Date
    May 2008
    Posts
    2,389

    Re: Console Window flashes on and off while running C++

    If you have enough knowledge about the editing the registries, then there is another way to make changes in environment variables. User environment variables are stored in the Registry in the key:
    HKEY_CURRENT_USER\Environment
    System variables are found in the key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
    The %PATH% must be stored in the registry as a REG_EXPAND_SZ registry value in the form that needs to be expanded. Editing the Registry is primarily for scripts used by systems administrators and is not recommended for the average PC user.

Similar Threads

  1. Windows Home Server console is not running
    By intoxicating in forum Networking & Security
    Replies: 4
    Last Post: 23-02-2011, 10:15 AM
  2. No sound in Window 7 running under BootCamp
    By Namuchi in forum Operating Systems
    Replies: 5
    Last Post: 27-04-2010, 05:24 AM
  3. Only one red light flashes on xbox 360 console
    By Kingfisher in forum Hardware Peripherals
    Replies: 5
    Last Post: 02-01-2010, 07:17 PM
  4. delete a line from the console window[C]
    By Preetish in forum Software Development
    Replies: 2
    Last Post: 26-03-2009, 01:12 PM
  5. Subject: Need to hide a console window.
    By Kitaen in forum Windows XP Support
    Replies: 1
    Last Post: 27-03-2008, 09:49 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,039,937.83286 seconds with 17 queries