Possible to do this with Borland C++?

Discussion in 'C++' started by laredotornado, Sep 22, 2009.

  1. Hi,

    I just downloaded a free Borland C++ compiler from

    http://www.codegear.com/downloads/free/cppbuilder

    I want to write a simple program for Windows platforms that
    - launches a program that opens a specific page on a web browser
    - has a custom .ico file that appears on the desktop
    - requries no setup program (much like PuTty)

    My question is, is it possible (and how), would I add a custom .ico
    file to my Borland C++ program?

    Thanks, - Dave
    laredotornado, Sep 22, 2009
    #1
    1. Advertising

  2. laredotornado wrote:
    > [..]
    > My question is, is it possible (and how), would I add a custom .ico
    > file to my Borland C++ program?


    Yes, it is possible. How? Ask in the newsgroup dealing with Borland.
    They used to be 'borland.public.cpp*'. Also consider that your question
    has more to do with Windows than with C++, and there are Windows
    programming newsgroups out there, go seek 'em out.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Sep 22, 2009
    #2
    1. Advertising

  3. On Sep 21, 7:01 pm, laredotornado <> wrote:
    > Hi,
    >
    > I just downloaded a free Borland C++ compiler from
    >
    > http://www.codegear.com/downloads/free/cppbuilder
    >
    > I want to write a simple program for Windows platforms that
    > - launches a program that opens a specific page on a web browser
    > - has a custom .ico file that appears on the desktop
    > - requries no setup program (much like PuTty)
    >
    > My question is, is it possible (and how), would I add a custom .ico
    > file to my Borland C++ program?
    >
    > Thanks, - Dave


    Oh, this is a C++ group only about C++. You are talking about
    resource files. The files have resources attached to them, think
    about the Macintosh files with the resources. They are called the
    forks of the file. There's a stream fork on the Macintosh file. On
    Windows a file name is all the file, but in the Win32 file system.
    So, you want to put an icon on the file and load it into the dialog
    you build from coordinates. You put the coordinate of the dialog into
    the dialog remplate file. It is an rc file, .rc, the resource
    compiler file. Sometimes people name them rc2 so the compiler doesn't
    think it's a compiler file. The point is that the resource compiler
    rc.exe that Borland probably distributes with its C++ compiler, or it
    could be their own rc.exe with even whatever file name they want,
    Borland made the Turbo C++ compiler which was and is very good.

    http://en.wikipedia.org/wiki/Resource_fork
    http://en.wikipedia.org/wiki/Resource_(Windows)

    You can write programs in C++ to load the dialogs that you can make
    with the resource compiler language. It is not difficult to parse,
    the resource compiler language. The dialog builders in Visual Studio
    make them automatically, saving them as RC files. By default in
    Visual Studio resource files are loaded in the resource editor,
    renaming them to rc2 sees then they are built as part of the project,
    configured in that way, with the text editor.

    Then, there are the Win32 functions of a Windows program. For
    example, to handle the Windows events from the Dialog, you install
    your functions in the windows message processing loop of the Win32
    program. For each message that your application gets from Windows, or
    however it is so defined, the functions in the message processing loop
    are handling the messages from Windows, so that they know what Windows
    is doing and Windows knows that the application responds to the
    message.

    The messages have the two variables after the message type tag. A
    Windows message is the code of the tag and two integer variables.
    There are differences in the variables in that they are the same
    variables for 16, 32, and 64 bit. So, the Windows functions to work
    with the Windows messages from windowsx.h should be used, for example
    the Message Crackers, and the macros for the message handlers.

    http://www.google.com/search?hl=en&source=hp&q=windowsx.h

    You'll notice that windows.h is included in every C and C++ file that
    is calling the functions of Windows. The tags that identify the
    messages are in the file. For example, all the Windows Messages begin
    with WM_. That helps to find them in the file, because hundreds of
    items in the file have WM_ to indicate that they are tags for Windows
    Messages.

    When a Win32 program is called, generally the programmer needs
    something like global variables for their function as the Win32
    application. So, in the function, there's a method to get the
    "private" variable, user data, as they call it, that is the pointer.
    Otherwise they might just use static variables. In C, that means the
    program has all the variables maintaining the state. Modern day
    Windows also has key/value string mapping for the private variable,
    besides just using one pointer to the struct that has all the data for
    the application to run, the parameters, but applications before that
    use GetWindowsLong function to get the context struct.


    typedef tagstruct CONTEXT
    {

    }
    CONTEXT;

    and also sometimes the structure is defined there with it's pointer
    name also, why not

    struct CONTEXT
    {

    }
    Borland has their own windows.h file which probably exactly matches
    the information that Borland supports using the Win32 API, where Win32
    is the generic name for much of the Windows API, the application
    programming interface. Also Watcom had a very good C++ compiler.
    Also the lcc Win32 compiler of Jacob Navia compiles source to DLL's
    that Windows can use, and uses Windows DLLs.

    I have a C++ project it makes a copy/paste buffer.
    Ross A. Finlayson, Sep 22, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RHJpa3Vz?=

    Borland C++ to Visual Studio

    =?Utf-8?B?RHJpa3Vz?=, Jun 30, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    6,030
    Scott
    Aug 8, 2005
  2. Piotr Karwatka

    Conversion MS VS.NET 2003 - Borland C#Builder

    Piotr Karwatka, Dec 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    356
    Kevin Spencer
    Dec 15, 2004
  3. Roul Ravashimka

    Borland Togethersoft

    Roul Ravashimka, May 5, 2004, in forum: Java
    Replies:
    0
    Views:
    366
    Roul Ravashimka
    May 5, 2004
  4. Falcon
    Replies:
    5
    Views:
    2,335
    Andrew Thompson
    May 20, 2004
  5. Replies:
    1
    Views:
    1,103
    SuperKoko
    Oct 2, 2006
Loading...

Share This Page