?
Solved

Console application (creating dynamically components)

Posted on 2003-03-06
9
Medium Priority
?
411 Views
Last Modified: 2010-04-04
How can I create dynamically component, for example tidtcpserver(indy) when working with console application.
I tried with code below but it doesn't work....

thank you in advance


program Project2;

{$APPTYPE CONSOLE}

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Spin, XPMan, IdBaseComponent, IdComponent, IdTCPServer,
  IdThreadMgr, IdThreadMgrDefault, ComCtrls,toolwin,extctrls,registry;

var
siet:tidtcpserver;
begin
siet:=tidtcpserver.Create(self);
siet.DefaultPort:=5611;
siet.Active:=true;
end.
 

0
Comment
Question by:Murdoc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 8080960
guessing your app will finish shortly

is this all the code?

0
 

Author Comment

by:Murdoc
ID: 8081159
It doesen't matter, i put short code to find out only how to create component dynamically.....
0
 
LVL 17

Accepted Solution

by:
geobul earned 225 total points
ID: 8081808
try

siet:=tidtcpserver.Create(nil);

Regards, Geo
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:smurff
ID: 8082263
AS geobul explained, I normally put these into a try..Except section :

siet := TidTcpServer.Create(nil);
 Try
  Try
   siet.Host := MyHost ..... {blah}
   { and other commands }
   Except
   Do something with error message
   end;
 Finally
  Siet.Free;
End;

This is not compilable code but I think you get the picture :)

Regards
Smurff
 
0
 

Author Comment

by:Murdoc
ID: 8088039
thanks for fast and good answer. I'd like to divide this points between geobul and smurf but i can not...:+{{
So i have to give this points to first good answer so don't be mad smurf.All i can do is increase points.

regards
0
 

Author Comment

by:Murdoc
ID: 8088053
P.S. this siet(tidtcpserver) suppose to be shiet...:+}}}
0
 
LVL 3

Expert Comment

by:smurff
ID: 8089260
>so don't be mad smurf

haha dont worry about it. I dont really care about the points :)
Ive learnt so much from this forum over the years and I just like to give something back. geobul has helped me a quite a few times over the years and he deserves every point he gets.

Have a good weekend everyone,
Smurff
0
 
LVL 17

Expert Comment

by:geobul
ID: 8089287
Thank you, Murdoc :-)
0
 

Author Comment

by:Murdoc
ID: 8109474
no problem
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month12 days, 18 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question