Thread: Newbie question about registries/files

  1. #1
    SirDavidGuy
    Guest

    Newbie question about registries/files

    Okay, this is a stupid, idiotic, newbie question, it just hasn't been answered in the tutorials & I couldn't find it with search. Please don't flame me.

    Okay, how do you make entries into the registry, and make text files in directories other than the one the program is in?

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    Okay, how do you make entries into the registry
    this should be asked in the windows forum (it's not C++ specific, it's windows specific)... but the API calls you're looking for are RegCreateKeyEx(), RegDeleteKeyEx(), RegDeleteValue(), RegQueryValueEx(), RegQueryInfoKey(), RegOpenKey() and RegCloseKey() etc. look into MSDN for registry functions.

    and make text files in directories other than the one the program is in
    use the full path name for the file name when you open it.

    ie, instead of:
    FILE* fp = fopen("myfile.txt", "w");
    do this (assuming windows/DOS)
    FILE* fp = fopen("C:\\whatever\\dir\\you\\want\\myfile.txt", "w");
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stupid Newbie question
    By TimL in forum C++ Programming
    Replies: 4
    Last Post: 07-22-2008, 04:43 AM
  2. C prog newbie question
    By Draginzuzu in forum C Programming
    Replies: 1
    Last Post: 02-03-2003, 06:45 PM
  3. a stupid question from a newbie
    By newcomer in forum C++ Programming
    Replies: 4
    Last Post: 01-11-2003, 04:38 PM
  4. confusion with integers (newbie question)
    By imortal in forum C Programming
    Replies: 7
    Last Post: 12-06-2002, 04:09 PM
  5. newbie class templates question
    By daysleeper in forum C++ Programming
    Replies: 2
    Last Post: 09-18-2001, 09:50 AM