Thread: A couple of questions .. please read

  1. #1
    sirtoby
    Guest

    A couple of questions .. please read

    1. How can I get some info from the registry, and store it into a variable. i.e. I want to get the info on where the quake3.exe is located by going into the registry and get it, and then store it into the variable q3dir.

    2. After the a function returns the value 0, shouldn't it go back to main() then?

    3. What data type should I use in order to get blank spaces .. i.e. how do I store a string like "c:\program files"? when I try to have it as char it shows up as c:\program .. not program files.

    thanks

  2. #2
    Registered User ski6ski's Avatar
    Join Date
    Aug 2001
    Posts
    133
    Whithout any code, it is hard to get anyone to answer these questions, so post some code.
    Posting code shows that you are putting an effort into your project, which makes people willing to answer you.
    For starters, i dont understand what these questions have in common.
    Second, for question #2&3 get a little deper into programming and you will find these answers.
    C++ Is Powerful
    I use C++
    There fore I am Powerful

  3. #3
    sirtoby
    Guest
    umm .. they have something incommon when it comes to my app .. and if you want some code .. well here you go.

    #include <iostream.h>
    #include <stdlib.h>
    #include <conio.h>
    #include <windows.h>

    void clrscr()
    {
    COORD coordScreen = { 0, 0 };
    DWORD cCharsWritten;
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    DWORD dwConSize;
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);

    GetConsoleScreenBufferInfo(hConsole, &csbi);
    dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
    FillConsoleOutputCharacter(hConsole, TEXT(' '), dwConSize, coordScreen, &cCharsWritten);
    GetConsoleScreenBufferInfo(hConsole, &csbi);
    FillConsoleOutputAttribute(hConsole, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten);
    SetConsoleCursorPosition(hConsole, coordScreen);
    }

    int end()
    {
    clrscr();
    return 0;
    }

    int start()
    {
    system("q3dir +set fs_game mod");

    return 0;
    }

    int setextra()
    {
    clrscr();
    cout << "### Ignite Q3 ### - by Teabag Productions";
    cout << "\n - Set Extra Options";
    cout << "\n\n # Please enter the dir name of the mod you want to play";
    cout << "\n # e.g. q3ut2";
    cout << "\n\n #:";
    char mod [99];
    cin >> mod;

    return 0;
    }

    int setloc()
    {
    clrscr();
    cout << "### Ignite Q3 ### - by Teabag Productions";
    cout << "\n - Set Location of Quake3.exe";
    cout << "\n\n # Please enter the full path of your quake3 executable";
    cout << "\n # e.g. c:\\quake III arena\\quake3.exe";
    cout << "\n\n #:";
    char q3dir [99];
    cin >> q3dir;

    // cout << q3dir;

    return 0;
    }

    int main()
    {
    clrscr();

    cout << "### Ignite Q3 ### - by Teabag Productions";
    cout << "\n\n ### MENU ###";
    cout << "\n\n #1 Set Location of .exe";
    cout << "\n #2 Set Extra Options";
    cout << "\n #3 Start Quake3";
    cout << "\n #4 Quit";
    cout << "\n\n #:";

    int MenuChoice;
    cin >> MenuChoice;
    if (MenuChoice == 1)
    setloc();
    else
    if (MenuChoice == 2)
    setextra();
    else
    if (MenuChoice == 3)
    start();
    else
    if (MenuChoice == 4)
    end();

    return 0;
    }

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    go to msdn and search for registry functions....

    particularly RegQueryValueEx()
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A couple of Basic questions
    By ozumsafa in forum C Programming
    Replies: 8
    Last Post: 09-26-2007, 04:06 PM
  2. Couple of Questions
    By toonlover in forum Windows Programming
    Replies: 10
    Last Post: 07-14-2006, 01:04 AM
  3. A Couple of Questions
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 12-03-2005, 06:47 PM
  4. A couple of theoretical questions about C
    By HAssan in forum C Programming
    Replies: 4
    Last Post: 11-10-2005, 08:09 AM
  5. A couple questions
    By punkrockguy318 in forum Tech Board
    Replies: 4
    Last Post: 01-12-2004, 10:52 PM