Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Open other Page
#1
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
Reply
#2
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?
Reply
#3
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 ();
}
// ------------------------------------------------ ---------------------------
Reply
#4
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
Reply
#5
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)