Пример переписан с книги Кент Рейсдорф-Borland C++ Builder. Освой самостоятельно
if(OpenDialog->Execute())
{
TChild* child = new TChild(this);
child->SetParent(this);
child->Image->Picture->LoadFromFile(OpenDialog->FileName);
child->ClientWidth=child->Image->Picture->Width;
child->ClientHeight = child->Image->Picture->Height;
child->Caption = OpenDialog;
child->Show();
}
[C++ Error] Unit1.cpp(23): E2247 '_fastcall TCustomForm::SetParent(TWinControl *)' is not accessible
[C++ Error] Unit1.cpp(27): E2034 Cannot convert 'TOpenDialog *' to 'AnsiString'
[C++ Error] Unit1.cpp(34): E2451 Undefined symbol 'dinamic_cast'
[C++ Error] Unit1.cpp(34): E2108 Improper use of typedef 'TChild'