Commenting functions



Hi!
I would like some help on deciding on a good way to write comments
that describes functions, like, it's parameters, return value and so
on.

Take this for example:

/*
* Returns 1 if parent is parent of window.
*/
int is_parent_of(struct Win *parent, struct Win *window)
{
...
}

Not very nice when the same word is used as the name of one
parameter, how would I separate those two? And also describe
return values and similar in a systematic way?

Also should one write "Returns 1 if ... " or "Return 1 if ..." ?
I know this is a personal style matter, but since I really don't
know it would be nice to know if there is some widely used style.
.



Relevant Pages

  • Re: Commenting functions
    ... Returns 1 if parent is parent of window. ... Must each parameter be a valid window? ... I know this is a personal style matter, ...
    (comp.programming)
  • Re: Need help solving a threading issue
    ... (represented by a SendMessage to the window) ... create HWND's on a secondary thread. ... thread, but the issues really *are* different if you create child windows, dialogs, etc. ... I agree a child HWND whose parent was created in another thread is an issue, ...
    (microsoft.public.vc.mfc)
  • Re: MFC and c++ problems
    ... the interface is defined by the control. ... Note that the messages of CButton are defined by the CButton ... I would think the parent would define which messages the child could send ... window didn't define the message itself, and you didn't design the classes ...
    (microsoft.public.vc.mfc)
  • Re: Connecting to the Same Table Twice
    ... > RelationshipID (primary key) ... > RelationshipName (parent, guardian, authorized pick-up, emergency contact, ... > you might put spouse names into a separate table linked to this table). ... > for each link between a child record and a caregiver record, ...
    (microsoft.public.access.gettingstarted)
  • Re: when and how do the the system inform the CFormView to redraw ?
    ... Thanks, Joe. ... Is it send WM_PAINT to parent earlier than childrens? ... > rectangle to keep drawing from spilling out onto the parent window; ... >>only the child ...
    (microsoft.public.vc.mfc)