Re: [fpc-pascal] RemoveDir: Error: Identifier not found

2012-04-25 Thread Sven Barth
Am 24.04.2012 17:35, schrieb Jürgen Hestermann: If I hit Alt+Up on "RemoveDir" within my program I am moved to D:\Programme\lazarus\fpc\2.6.1\source\rtl\objpas\sysutils\diskh.inc(21,10) with the function header declaration but when doing it again on "RemoveDir" within this file I get: Error: ide

Re: [fpc-pascal] Program without window but messages

2012-04-25 Thread Sven Barth
Am 24.04.2012 18:25, schrieb Jürgen Hestermann: I wanted to write a program that has no window but may show messages to the user. I have lots of such programs written with Virtual Pascal but I am struggling to do the same with Free Pascal/Lazarus. A simple test program would look like this: ---

[fpc-pascal] Re: Program without window but messages

2012-04-25 Thread leledumbo
You need to call Application.Initialize prior to anything if you want to use LCL features (including its dialogs). Your uses clause seems overkill. Only Interfaces, Forms and Dialogs units required for ShowMessage function. -- View this message in context: http://free-pascal-general.1045716.n5.na

Re: [fpc-pascal] Sending break on (Windows) serial comms

2012-04-25 Thread Mark Morgan Lloyd
Mark Morgan Lloyd wrote: Marco van de Voort wrote: In our previous episode, Mark Morgan Lloyd said: Marco, I see you had a StackOverflow question on this a year or so ago. Did you ever get anywhere with it in practice? It was an idea to lower the overhead and improve the reliability of our se

[fpc-pascal] Re: does disconnected tLSocket auto destroy in lnet

2012-04-25 Thread ZHANG Dao-yuan
On 04/24/2012 05:01 PM, ZHANG Dao-yuan wrote: I'm using tLTcp with tLEventer. I've set tLTcp.eventer to the associated tLEvent object and call tLEvent.callAction to wait for new events. After a socket disconnected, OnDisconnect gets called shipped with an aSocket:tLSocket parameter. Should I c

Re: [fpc-pascal] Program without window but messages

2012-04-25 Thread Jürgen Hestermann
Sven Barth schrieb: >> When I create a new project and select to create an "Application", >> copy the above into the main program (ignoring Unit1.pas) and run >> the program I get an exception "Fensterklasse nicht gefunden" (in >> german, although I setup Lazarus in english!) > > This specific exc

Re: [fpc-pascal] Re: Program without window but messages

2012-04-25 Thread Jürgen Hestermann
leledumbo schrieb: > You need to call Application.Initialize prior to anything if you want to use > LCL features (including its dialogs). Is "ShowMessage" part of the LCL? I thought that it comes with Free Pascal directly because the wiki http://wiki.freepascal.org/Dialog_Examples/de#ShowMess

Re: [fpc-pascal] RemoveDir: Error: Identifier not found

2012-04-25 Thread Jürgen Hestermann
Sven Barth schrieb: > You are talking about doing this in Lazarus? Then you should complain on the Lazarus list, > because such lookups are part of the CodeTools of Lazarus (and as this function is part of > an include file, there are some problematic cases still) Yes, you are right (again). ;

Re: [fpc-pascal] Re: Program without window but messages

2012-04-25 Thread Jonas Maebe
On 25 Apr 2012, at 17:49, Jürgen Hestermann wrote: > Is "ShowMessage" part of the LCL? I thought that it comes with Free Pascal > directly > because the wiki http://wiki.freepascal.org/Dialog_Examples/de#ShowMessage , > which > explains this message, is located on wiki.freepascal.org. http://w

Re: [fpc-pascal] Program without window but messages

2012-04-25 Thread Jürgen Hestermann
JC Chu schrieb: > Try this. > program Test; > {$MODE DELPHI} > {$APPTYPE GUI} > uses > {$IF Defined(UNIX) and Defined(UseCThreads)}cthreads,{$ENDIF} > Interfaces, Forms, Dialogs; > > begin > Application.Initialize; > ShowMessage('Test'); > end. Yes, this works

Re: [fpc-pascal] Re: Program without window but messages

2012-04-25 Thread Tomas Hajny
On Wed, April 25, 2012 17:49, Jürgen Hestermann wrote: > leledumbo schrieb: > > You need to call Application.Initialize prior to anything if you want > to use > > LCL features (including its dialogs). > > Is "ShowMessage" part of the LCL? I thought that it comes with Free > Pascal directly > beca

Re: [fpc-pascal] Program without window but messages

2012-04-25 Thread Jürgen Hestermann
Howard Page-Clark schrieb: > A GUI program requires a "main window" since that is the avenue for user interaction. > You can hide that window (not "ignore" it) as in the following program, which compiles > and runs. However, I can't myself see the use of such truncated GUI functionality. > Once

Re: [fpc-pascal] Re: Program without window but messages

2012-04-25 Thread Jürgen Hestermann
Jonas Maebe schrieb: >> Is "ShowMessage" part of the LCL? I thought that it comes with Free Pascal directly >> because the wiki http://wiki.freepascal.org/Dialog_Examples/de#ShowMessage , which >> explains this message, is located on wiki.freepascal.org. > http://wiki.freepascal.org is exactly

Re: [fpc-pascal] Program without window but messages

2012-04-25 Thread JC Chu
As leledumbo has pointed out, you need to call Application.Initialize() before using LCL features. The code for TApplication.Initialize() shows that it initializes the currently active widget set, which is maintained by the Interfaces unit. ShowMessage() relies ultimately upon TWidgetSet.PromptUs

Re: [fpc-pascal] Program without window but messages

2012-04-25 Thread Sven Barth
On 24.04.2012 18:25, Jürgen Hestermann wrote: I wanted to write a program that has no window but may show messages to the user. I have lots of such programs written with Virtual Pascal but I am struggling to do the same with Free Pascal/Lazarus. A simple test program would look like this: -

[fpc-pascal] typesafe typecasting

2012-04-25 Thread Bernd
Hi, While translating some headers I have run across the following problem (I am sure had this in different variations many times before already and always lived with it and ignored it by casting from untyped pointers). Consider this situation: unit Unit1; {$mode objfpc}{$H+} interface type

Re: [fpc-pascal] typesafe typecasting

2012-04-25 Thread JC Chu
When you assign a “specialized” pointer, say a PInteger, to a generic Pointer variable, the assignment is valid because the compiler knows that PInteger is a subtype of Pointer. There is however no general way of determining a subtype relation between procedural types, even if some of their parame