Text editing related question in C++ Builder, please help.

This is a discussion on Text editing related question in C++ Builder, please help. within the Windows Programming forums, part of the Platform Specific Boards category; My text editor is pretty much completed, just that whenever I associate (.txt) file to it, double clicks on a ...

  1. #1
    Unregistered
    Guest

    Lightbulb Text editing related question in C++ Builder, please help.

    My text editor is pretty much completed, just that whenever I associate (.txt) file to it, double clicks on a text file, the program started, but just won't open the text file instead it start a new untitled file. is there something I can put in the formcreate to fix this?

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Yes, the command line argument contains the file name of the file that you opened. Just parse it out and you should be good to go.

  3. #3
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    Use the ParamStr call in C++ Builder to get the runtime arguments, i.e. the filename to autoload will be at index zero:

    extern PACKAGE AnsiString __fastcall ParamStr(int Index)

    When setting up the registry, take care to do this correctly, otherwise spaces in the file path will be treated as argument seperators and your filename will be broken across several indicies.

    When setting the 'HCLASSES_ROOT/Product_Name/shell/open/command' key, use the following format:

    "full app path" "%1"

    make sure you include the quote marks as above.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A question about MacVim vs other text editors...
    By maccat in forum Tech Board
    Replies: 3
    Last Post: 02-04-2009, 05:17 AM
  2. Question related to getpid and getppid
    By g_p in forum C Programming
    Replies: 4
    Last Post: 12-18-2006, 11:35 AM
  3. text simple question
    By Unregistered in forum Game Programming
    Replies: 2
    Last Post: 04-26-2002, 10:45 AM
  4. another text game question
    By Unregistered in forum Game Programming
    Replies: 4
    Last Post: 03-09-2002, 11:02 PM
  5. Text Game Question
    By Unregistered in forum Game Programming
    Replies: 4
    Last Post: 03-08-2002, 04:55 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21