Event Handling

This is a discussion on Event Handling within the C++ Programming forums, part of the General Programming Boards category; Hi, Thnx for clicking, I'm Dhananjay, And these days I'm busy in developing a s/w in C. I've a prob? ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    1

    Unhappy Event Handling

    Hi,
    Thnx for clicking,
    I'm Dhananjay, And these days I'm busy in developing a s/w in C. I've a prob? Do u know how to trap events in 'C'. like vb or java?
    Plz revert me.
    Thnx again.

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    What types of events?

    If you are talking about ON ERROR GOSUB|GOTO or ON UEVENT GOSUB|GOTO then no there is nothing like that.

    You can trap for events by writing interrupt handlers, new signal handlers (in signal.h), and by writing error trapping code inside of your program. Most functions, interrupts, etc., will return a value if the operation was successful or if it was not. Interrupts will return a value in _AX (most will) and most handlers have docs which explain what the error was according to that value.

    There are other ways but for the most part in C you take care of the error handling. Limited error checking means more speed for your program and less 'C' overhead.

    VB will check the bounds of your array to see if you overran them. C assumes you should be smart enough not to do that and so allows you to write off the end of the array into whatever is beyond your array, even if it's Windows that's beyond your array. No bounds checking in C for arrays.

    If you are talking about Windows events, yes you can respond to Windows events. Check the Windows board for lots of info about Windows events and how to respond to them.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. event handling is serialized in MS Visual Studio C++ 2005 ??
    By mynickmynick in forum Windows Programming
    Replies: 3
    Last Post: 08-07-2008, 04:47 AM
  2. Event handling between forms
    By ejohns85 in forum C# Programming
    Replies: 1
    Last Post: 12-11-2006, 07:14 PM
  3. Standard Win Forms Event Handling? (& #develop)
    By Zeusbwr in forum C# Programming
    Replies: 1
    Last Post: 04-22-2005, 02:59 PM
  4. Event handling
    By gvector1 in forum C# Programming
    Replies: 4
    Last Post: 07-09-2003, 03:32 AM

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