Open other Page

<< Click to Display Table of Contents >>

Navigation:  Forum >

Open other Page

Forum link

 


 

10-21-2020, 05:01 PM:

 

Hi Guys

 

I have some little problem

 

I have two forms on my test application. But I can not open the second form.

 

I have create a button. On click this button

 

Form3->Show(); not work

 

IWForm3->Show(); not work

 

TIWForm3->Show(); not work....

 

Can you helb me?  I work with c++Builder.

 

Thanks

 


 

10-21-2020, 06:24 PM:

 

1) "I can not open the second form." is not very descriptive. What exactly happens when you try these?

 

2) Have you looked at the demos? While C++ has a slightly different syntax, the steps to do so are the same as Delphi.

 

3) What is Form3? I assume a variable? Have you created an instance?

 


 

10-23-2020, 04:08 PM:

 

Hello kudzu

 

Thanks.

 

Yes, I watched the demos.

 

In the Delphi introduction there is a second page with

 

TIWForm2.Create (WebApplication) .Show;

 

opened and displayed.

 

I have Unit1 and Unit2 with TIWForm1 and TIWForm2 respectively

 

I integrated Unit2 into Unit1. But none of the spellings lead to any result.

 

Here is the code

 

// ------------------------------------------------ ---------------------------

 

#include <vcl.h>

 

#pragma hdrstop

 

#include "Unit1.h"

 

#include "Unit2.h"

 

#include "UserSessionUnit.h"

 

// ------------------------------------------------ ---------------------------

 

#pragma package (smart_init)

 

#pragma link "uLoginDlg"

 

#pragma link "uSecControl"

 

#pragma link "IWCompGradButton"

 

#pragma resource "* .dfm"

 

// ------------------------------------------------ ---------------------------

 

__fastcall TIWForm1 :: TIWForm1 (TComponent * Owner)

 

: TIWAppForm (Owner)

 

{

 

}

 

// ------------------------------------------------ ---------------------------

 

void setAsMainForm () {

 

TIWForm1 :: SetAsMainForm ();

 

}

 

#pragma startup setAsMainForm

 

void __fastcall TIWForm1 :: IWGradButton1Click (TObject * Sender)

 

{

 

TIWForm1-> Show ();

 

}

 

// ------------------------------------------------ ---------------------------

 


 

10-24-2020, 08:21 PM:

 

When I say the expression

 

WebApplication-> ShowForm (TIWForm2);

 

comes the following error message:

 

[bcc32 error] Unit1.cpp (51): E2108 Invalid use of typedef 'TIWForm2'

 

Full parser context

 

Unit1.cpp (33): Analysis: void _fastcall TIWForm1 :: IWGradButton1Click (TObject *)

 

The form I want to call is called TIWForm2 and is in Unit2.

 

Unit2 is included via an include.

 

What can I do?

 

Thanks

 


 

10-27-2020, 02:53 PM:

 

TIWForm1-> Show ();

 

This will never work. TIWForm1 is the class. You need to create an instance of that class and call Show on the instance.

 

TIWForm2.Create (WebApplication) .Show;

 

This contains a constructor. In Delphi the constructor is the Create.