Gerhard Posted August 1, 2017 Share Posted August 1, 2017 Hi I am new to uniGUI and a C++ programmer. I have a very simple problem, that is to create a form from my main form. In standard C++ i will do it as follows by calling this function from my main form: //---------------------------------------------------------------------------void __fastcall TResByWebReservationForm201701::UniButton1Click(TObject *Sender){ TPickItemsForm* PickItemsForm= new TPickItemsForm(this); PickItemsForm->Show();}//--------------------------------------------------------------------------- But I get the error: I notice in Pascal the calling convention is different to standard, but have no idea how to call this in C++. 1) What is the parameter to call another form? 2) Is there some special code I must enter into the form? Regards Gerhard Stoltz Link to comment Share on other sites More sharing options...
Gerhard Posted August 1, 2017 Author Share Posted August 1, 2017 Hi Thanks to Farshad I have this sorted out: For any who is new here are the changes you must make to a new form in C++: 1) Under header enter (*.h): TNewForm* NewForm; 2) In the main file enter (*.cpp) TNewForm *NewForm(void){ return( (TNewForm *)UniMainModule()->GetFormInstance(__classid(TNewForm)));}//--------------------------------------------------------------------------- Now call the form from Main Form directly as: NewForm()->Show(); Do not create a new instance with new. Gerhard Stoltz Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted August 2, 2017 Administrators Share Posted August 2, 2017 Hi You dont need to make any change at all. Functions are already defined. Sent from my SM-N900 using Tapatalk Link to comment Share on other sites More sharing options...
Gerhard Posted August 2, 2017 Author Share Posted August 2, 2017 Thanks Farshad I come right now that I understand that Link to comment Share on other sites More sharing options...
GerhardV Posted August 3, 2017 Share Posted August 3, 2017 Another fellow South-African...welcome! Link to comment Share on other sites More sharing options...
mhmda Posted August 3, 2017 Share Posted August 3, 2017 Move delphi... Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now