Parameter Help

This is a discussion on Parameter Help within the C++ Programming forums, part of the General Programming Boards category; hello all void __fastcall TadminForm::StudentInfoButtonClick(TObject *Sender) well, can some body explains to me more about the parameter *Sender, and how ...

  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    37

    Parameter Help

    hello all

    void __fastcall TadminForm::StudentInfoButtonClick(TObject *Sender)

    well, can some body explains to me more about the parameter *Sender, and how could I use it?

    Thanks

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,066
    It's a pointer toa TObject. Now, I don't know this particular function, but I'd imagine a function call would look similar to:

    Code:
    TadminForm myForm;
    TObject myObj;
    
    myForm.StudentInfoButtonClick(&myObj);  // Note that you pass the address of an object to a pointer
    Sent from my iPadŽ

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    37
    well I will u the case that surrounds me:
    I have mutiple forms:
    one is the administrator form and the other is normal user and other forms,
    There are some common forms between the administrator and the normal user, so when the user on that form clicks a button, I want to know from where it is coming, so that I can display either the admin form or the user form

  4. #4
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,066
    Why don't you start by telling us what library this is from so people that reply don't have to guess. Personally, I think it looks like a class you created. It's definitely not standard.

    If you want to check whether a user is administrator or just a regular user, you can either have them log in initially and flag their status or you'd have to get some sort of computer ID and compare that to an admin list. The first option would obviously make calls to forms much quicker.
    Last edited by SlyMaelstrom; 05-02-2006 at 07:00 AM.
    Sent from my iPadŽ

  5. #5
    Registered User
    Join Date
    Apr 2006
    Posts
    37
    what do u mean by library ?
    I working on Borland C++ enterprise 6, and as I have told u there are a lot of normal user forms .,..............

  6. #6
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,066
    I'm going to flat out guess that you don't know what you're doing and suggest that you go back to the basics of C++.

    If you don't know the difference between a library and a compiler/IDE, then you're really going to have a lot of trouble programming this.
    Sent from my iPadŽ

  7. #7
    ZuK
    ZuK is offline
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    I don't know the framework that you use

    Code:
    void __fastcall TadminForm::StudentInfoButtonClick(TObject *Sender)
    Looks like StudentInfoButtonClick() is a method of some kind of a window that gets called when a button is clicked. Sender is most propably a pointer to the actual button that was clicked.
    Suppose you could cast it to the actual type of button object, or use TObject's virtual methods to query its properties.
    Kurt

  8. #8
    Registered User
    Join Date
    Apr 2006
    Posts
    37
    thats right Zuk, that what I was searching for ...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. my error is storage class specified for parameter
    By meli in forum C Programming
    Replies: 5
    Last Post: 03-27-2009, 12:06 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. cannot start a parameter declaration
    By Dark Nemesis in forum C++ Programming
    Replies: 6
    Last Post: 09-23-2005, 02:09 PM
  5. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM

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