Which of Them Work First

This is a discussion on Which of Them Work First within the C++ Programming forums, part of the General Programming Boards category; I am new in C development and have to understand a program which was written with Borland Compiler, but something ...

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    18

    Which of Them Work First

    I am new in C development and have to understand a program which was written with Borland Compiler, but something make it dificult to understand there are two functions in program one of them is:

    __fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)

    Other is:

    void __fastcall TForm1::FormCreate(TObject *Sender)

    but I confused which of them works first, and when they are triggering one of them constructor and other one is a form create event I really about to lose the plot pls help me.
    Thanx you in advance.

  2. #2
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    This is C++. Should be moved there too.
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  3. #3
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    Well, it's C++ and not C, so....

    But anyway:

    Code:
    __fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
    This is a C++ constructor for a TForm1 object. It is called when a new TForm1 object is created and given a TComponent pointer.

    Code:
    void __fastcall TForm1::FormCreate(TObject *Sender)
    This is a function belonging to TForm1. If it's static, then it belongs to the class and can be called without a TForm1 object being present, and hence could be called first. Otherwise, you need a TForm1 object in order to call this function, and I would expect a constructor from TForm1 must be called first.

  4. #4
    Registered User
    Join Date
    Aug 2007
    Posts
    18
    The code is a C code, but maybe vcl working in c++ and c and probably in delphi as well. Its just a dll no more, Do I need to open same topic in other forums as well?

    Thanx u MacGyver, I understood one of them need to be called other one is a constructor and will be caled automatically, ok then I think at first formcreate will also call automatically but now everything is much more clear thank you in advance
    Last edited by mindtrap; 08-24-2007 at 02:26 AM.

  5. #5
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    No, a moderator will move it.

  6. #6
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    It is certainly C++ or some other OOP. C doesn't support classes. (Lol, MacGyver, you were faster this time. )
    "The Internet treats censorship as damage and routes around it." - John Gilmore

  7. #7
    Registered User
    Join Date
    Aug 2007
    Posts
    18
    C doesnt support but vcl support classes whatever thanx for your help again and other time I would be more careful. Forgive me I am used to use lego languages such as c#. C looks to memore than a nightware.

  8. #8
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    http://en.wikipedia.org/wiki/Visual_Component_Library

    According to that page, VCL is written in Object Pascal and can be used by C++ in the manner that you're doing. Looks like C++ to me.

  9. #9
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    Moved.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  10. #10
    chococoder
    Join Date
    Nov 2004
    Posts
    515
    VCL != C
    VCL is indeed written in Object Pascal and has interfaces with C++ and Delphi (and maybe C# by now as well, not sure about that).

    In no small part that's because Borland C++ Builder and Delphi share the same linker, so obj and lib files created with either can be linked against obj and lib files created with the other.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strcmp returning 1...
    By Axel in forum C Programming
    Replies: 12
    Last Post: 09-08-2006, 07:48 PM
  2. getline() don't want to work anymore...
    By mikahell in forum C++ Programming
    Replies: 7
    Last Post: 07-31-2006, 10:50 AM
  3. Why don't the tutorials on this site work on my computer?
    By jsrig88 in forum C++ Programming
    Replies: 3
    Last Post: 05-15-2006, 10:39 PM
  4. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 11:39 AM
  5. DLL __cdecl doesnt seem to work?
    By Xei in forum C++ Programming
    Replies: 6
    Last Post: 08-21-2002, 04:36 PM

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