This code snippet has been taken from Marko Cantu's Delphi Developer's
HandBook.
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
MyClass: TComponentClass;
MyComp: TComponent;
begin
MyClass := TComponentClass (GetClass (ComboBox1.Text));
if MyClass = nil then
Beep
else
begin
MyComp := MyClass.Create (self);
MyComp.Name := GetNextName (MyClass);
if MyClass.InheritsFrom (TControl) then
// if MyComp is TControl then // alternative version
begin
TControl (MyComp).Left := X;
TControl (MyComp).Top := Y;
TControl (MyComp).Parent := self;
end;
end;
UpdateList;
end;
MyComp := MyClass.Create (self);
I couldn't convert this line to C++ Code .
Does any body has any idea how this line will be convert to C++ Builder.
Thanks.
Sabetay
Sabetay Toros <bil...@superonline.com> wrote in message
news:3c14b991_1@dnews...
Gambit
"Sabetay Toros" <bil...@superonline.com> wrote in message
news:3c14b991_1@dnews...
Thank you for your kind reply. That was exactly the answer that I was
waiting.
But I wonder, if there is any other different way to achieve this feature.
If not, my next question to the group is as follows: How can I mix
Delphi code with Builder? Where can I find information, help & examples?
Thanks,
Sabetay Toros
"Remy Lebeau" <gamb...@gte.net> wrote in message news:3c14f463$1_2@dnews...
> But I wonder, if there is any other different way to achieve this
feature.
As I said, C++ doesn't support what you're trying to do, but Delphi does.
> How can I mix Delphi code with Builder?
As I said, simply put the code into its own unit and then add that Delphi
unit to your C++ project via "Add to Project". Builder will generate C++
header files for the Delphi code so that you can use them.
Gambit
Thanks
"Remy Lebeau" <gamb...@gte.net> wrote in message news:3c16439f$4_2@dnews...