Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 14th, 2004, 08:07 AM
Domisedon's Avatar
Domisedon Domisedon is offline
My beer is empty....
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: South Africa
Posts: 73 Domisedon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 54 m 37 sec
Reputation Power: 12
event handler in console mode

I'm using the TurboPower Async Professional CLX in a console mode application.
  1. Assigning an event handler in console mode
    I need to assign an event handler. I know that in a TComponent/TForm you put the function in your private declarations and the assign it to the onEvent property:

    procedure comPortTrigger(CP: TObject; Msg, TriggerHandle, Data: Word);

    comPort.onTrigger := comPortTrigger;

    When trying this in a console application I get:

    [Error] Project1.dpr(19): Incompatible types: 'method pointer and regular procedure'

    How do I get this right?
  2. Getting the components to work in console mode
    The TurboPower Async Professional CLX components work like a charm as long as I coding a visual application. When coding a console application it does not work. The application I'm writing will run as a service on a Linux machine and must be able to read/write data from several devices (up to 32) connected via serial ports (multi port boards - using the Moxa CP114s at the moment). If you can tell me how to get it fixed it would be muched appreciated.

    Alternatively please recommend (or guide me in writing) components that can read/write from serial ports coded in Kylix (or using DLL's). Must run in Linux though. The devices output under full load about 9.6kB(yte) per second per port and we need to write to that same port whilst reading (or stop reading, write, continue reading) without the system falling over.

Last edited by Domisedon : May 14th, 2004 at 08:14 AM.

Reply With Quote
  #2  
Old May 14th, 2004, 01:46 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 9th Plane (9000 - 9499 posts)
 
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
Posts: 9,406 Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level)Scorpions4ever User rank is General 46th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 9 h 47 m 28 sec
Reputation Power: 4080
I described how to do button events dynamically in this thread:
http://forums.devshed.com/t143784/s.html

The principle is the same for any event handler. Only the number of parameters and their types will differ depending upon the event.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Reply With Quote
  #3  
Old May 15th, 2004, 06:29 AM
Domisedon's Avatar
Domisedon Domisedon is offline
My beer is empty....
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2002
Location: South Africa
Posts: 73 Domisedon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 54 m 37 sec
Reputation Power: 12
Thanks - but I tried it and it doesn't work. It seems that you cannot do event handlers in a console application without writing an additional class.

The big thing I've got to do is get serial port access and the components I've got just don't do the job in console mode.

Any help would be greatly appreciated

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > event handler in console mode

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap