C++ Builder IDE >> Delphi forms in C++ builder

by Thomas » Thu, 28 Oct 2004 01:23:00 GMT

hi

Through help from this group I was able to compile delphi units in C++
builder, but
I am having trouble bring in units with forms in them into c++ builder.

What is the best way to bring forms etc created in delphi, into C++ builder
IDE?

Thanks

Thomas



C++ Builder IDE >> Delphi forms in C++ builder

by Palle Meinert » Thu, 28 Oct 2004 04:17:38 GMT


Although you state what kind of problems you experience i think you could
benefit from reading this link. This will enable BCB to edit forms for
Delphi-units.

http://www.falafel.com/Flogs/PermaLink.aspx?guid=e596330d-8af1-466f-a049-180b45221f7e

/Palle

C++ Builder IDE >> Delphi forms in C++ builder

by Palle Meinert » Thu, 28 Oct 2004 04:28:18 GMT

> Although you state what kind of problems you experience i think you could

Sorry, there is missing a "do not"

/Palle

C++ Builder IDE >> Delphi forms in C++ builder

by Craig Farrell » Thu, 28 Oct 2004 06:17:30 GMT

Hi,



Just add them to your project and compile. Avoid specifying
a project option for intermediate output directory in a project
that contains Pascal files, as it messes up the make logic.

--Craig

C++ Builder IDE >> Delphi forms in C++ builder

by JackInBottle » Fri, 29 Oct 2004 09:41:01 GMT

Hear are something I concluded:

1. form file *.dfm and delphi file *.pas should be in same directory
2. unit file (*.pas) should like this :

unit <UnitName>; {the UnitName should exactly same as the file name}
interface
...
implmentation
{$R *.dfm} {this guy actually binds UnitName.dfm to this unit}
end.

3. In C++ Builder, you only need add the UnitName.pas into the project, the
UnitName.dfm file will be linked to the unit autmatically.

This is what I am creating and emberding Delphi code into C++ Builder.

Similar Threads

1. Transcrypt code form delphi to C++Builder

2. C++ Builder 9 or C++ Builder 2005 with VCL at BorCon 2004

Or will it be RAD C++ BuilderX with VCL?

ER

3. C++ Builder 9 or C++ Builder 2005 with VCL at BorCon 2004 - C++ Builder

4. Next release will be C++ Builder 9 - equalize C++ Builder 9 to

Kevin < XXXX@XXXXX.COM > wrote:
>more likely to be C++Builder 2006 or something like that...  

Wouldn't it be nice to have a stable C++Builder 2006 RAD environment?

I would love to use that RAD to develop even PockePC apps!

Eddie


5. problems to compile a program written in Builder C++ 1.0 in Builder C++ 6.0 - C++ Builder IDE

6. c++ builder v6 or c++ builder 2006

Hi,

i m using Bcb5 and wanna use either v6 or 2006. Which one is better any 
suggestions? pros, cons?

thanks 


7. Delphi code to Visual C++ by C++ Builder - C++ Builder IDE

8. Calling a C++ Form from a Delphi Form [solved]

Remy Lebeau (TeamB) wrote:
Thanks for the quick response.

> What is the exact linker error?  You need to be more specific.
I needed extern "C" for the delphi side to see it. (solved).
> 
>> TForm *GetTForm1() { if (Form1==0) Form1 = new TForm1(Form1);
>> return Form1;

I read that Delphi has everything by reference so it's changed to:
TForm & WINAPI _export GetTForm1() {

	if (Form1==0)  Application->CreateForm(__classid(TForm1), &Form1);
	 return *Form1;
	}
}


> 
> You are passing the NULLified Form1 pointer as the Owner of the TForm1 
> instance you are trying to create for the Form1 pointer.  If you don't want 
> the new form to have an Owner, then specify NULL explicitally instead:
> 
>     TForm *GetTForm1()
>     {
>         if (Form1==NULL)
>             Form1 = new TForm1(NULL);
>         return Form1;
>     }

Not the intent in this case, once the form is created it shouldn't go 
away so it's owner should be the application. However this is good to 
know anyways.


> Now, with that said - I would suggest moving the body of GetTForm() into the 
> form's .cpp file instead of having it inlined in the header file:

OK, done.

new code is (inside unit1.cpp)

extern "C" {

TForm & WINAPI _export GetTForm1() {

	if (Form1==0)  Application->CreateForm(__classid(TForm1), &Form1);
	 return *Form1;
	}
}


Thanks for your help!