RAD Studio |  |

E2457: Delphi style classes must be caught by reference (C++)
Example
Collapse All

You can only catch a Delphi style object by pointer.

Example
Copy Code

    void foo(TObject *p)
    {
         try
         {
              throw(p);
         }
         catch    (TObject o)    // Error
         {
         }
         catch  (TObject *op)    // OK
         {
         }
    }

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!