Главная страница | назад





Article #19376: How do I do Delphi-like 'is' and 'as' checks?

 Question and Answer Database
FAQ: FAQ4376C — How do I do Delphi-like 'is' and 'as' checks?
Category: C/C++ Language Issues
Platform: All-32Bit
Product: All-CBuilder,
Question:
How do I do Delphi-like 'is' and 'as' checks in
C++Builder?
Answer:
The C++ way:
if (dynamic_cast(Application->Forms[0]) != 0) {..}
The VCL way:
if (Application->Forms[0]->InheritsFrom(__classid(TMyForm))) {..}
6/16/99 2:49:00 PM

Last Modified: 01-SEP-99