Hello
I get strange results form GetLasError in WinCe;
something like 1449435930, for example;
I use this:
{$include d:\lazarus\fpc\2.2.4\source\rtl\wince\wininc\coredll.inc}
function GetLastError:DWORD; external KernelDLL name 'GetLastError';
var
err: dword;
begin
MutexHandle := CreateM
- Original Message -
From: "Graeme Geldenhuys"
To: "FPC-Pascal users discussions"
Sent: Thursday, October 29, 2009 7:51 PM
Subject: Re: [fpc-pascal] X, Y co-ordinate system under OS/2
On 29/10/2009, Juha Manninen wrote:
If done right, the code doing coordinate conversion should be
On 29/10/2009, Marco van de Voort wrote:
>
>
> No, probably mixed sysutils and strings(?) use. pstring is defined in both
> TP and Delphi. Once to short, once to ansistring
That that must be FPC that is getting confused. In Lazurus I when
"Project > New > Free Pascal application". That's as bas
In our previous episode, Henry Vermaak said:
> >
> > Trying what you suggested, I get the following compiler error.
> >
> > project1.lpr(20,11) Error: Incompatible types: got "PString" expected
> > "PChar"
>
> This is probably dependant on compiler modes?
No, probably mixed sysutils and strings(
2009/10/29 Mattias Gaertner :
>
> I hope you mean {$mode objfpc}{$H+}
:-) Yes.
--
Regards,
- Graeme -
___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pasc
2009/10/29 Mattias Gaertner :
> On Thu, 29 Oct 2009 22:28:39 +0800
> 章宏九 wrote:
>
>> Thank you for all your detailed answers. I read information about
>> lazbuild, but I think using Lazarus is much more easier. Since I am
>> used to vim, it might cost me some time to get familiar with it.
>
> Mayb
On Thu, 29 Oct 2009 16:42:23 +0200
Graeme Geldenhuys wrote:
> 2009/10/29 Mattias Gaertner :
> >
> > It compiles here. Probably you use some special units.
>
> Weird... As I mentioned, I'm using FPC 2.3.1 (64bit) under Linux and
> $mode objfpc.
I hope you mean {$mode objfpc}{$H+}
Mattias
2009/10/29 Mattias Gaertner :
>
> It compiles here. Probably you use some special units.
Weird... As I mentioned, I'm using FPC 2.3.1 (64bit) under Linux and
$mode objfpc.
>
> Graeme, why don't you just change the type of 'Text' to string?
That's the plan - eventually. But the code is large and
2009/10/29 Henry Vermaak :
>
> This is probably dependant on compiler modes?
I'm using: $mode objfpc
> You may have to do it like this:
>
> StrDispose(Text);
> Text := StrAlloc(length(s) + 1);
> StrPCopy(Text, s);
Ah, now it works plus no memory leaks.
Thanks! :-)
Wow, something as simple as
On Thu, 29 Oct 2009 22:28:39 +0800
章宏九 wrote:
> Thank you for all your detailed answers. I read information about
> lazbuild, but I think using Lazarus is much more easier. Since I am
> used to vim, it might cost me some time to get familiar with it.
Maybe if you ask Martin in the right way he w
Thank you for all your detailed answers. I read information about
lazbuild, but I think using Lazarus is much more easier. Since I am
used to vim, it might cost me some time to get familiar with it.
Thanks again.
2009/10/27 Mattias Gaertner :
> On Tue, 27 Oct 2009 09:55:03 +0200
> Graeme Geldenhu
2009/10/29 Graeme Geldenhuys :
> On 29/10/2009, Mattias Gaertner wrote:
>>
>>
>> Text:=strnew(PChar(s));
>
> You read my mind. I was going to ask if it's ok to cast a PString to a PChar.
>
> Trying what you suggested, I get the following compiler error.
>
> project1.lpr(20,11) Error: Incompatible
On Thu, 29 Oct 2009 15:44:09 +0200
Graeme Geldenhuys wrote:
> On 29/10/2009, Mattias Gaertner wrote:
> >
> >
> > Text:=strnew(PChar(s));
>
> You read my mind. I was going to ask if it's ok to cast a PString to
> a PChar.
Yes.
But it will not change the reference count.
> Trying what you sugg
On 29/10/2009, Mattias Gaertner wrote:
>
>
> Text:=strnew(PChar(s));
You read my mind. I was going to ask if it's ok to cast a PString to a PChar.
Trying what you suggested, I get the following compiler error.
project1.lpr(20,11) Error: Incompatible types: got "PString" expected "PChar"
Changi
On Thu, 29 Oct 2009 13:20:42 +
Henry Vermaak wrote:
> 2009/10/29 Mattias Gaertner :
> > On Thu, 29 Oct 2009 15:00:53 +0200
> > Graeme Geldenhuys wrote:
> >
> >> Hi,
> >>
> >> Do I create a memory leak if I cast a PChar it a AnsiString. Then
> >> append text to the AnsiString and then cast it
2009/10/29 Mattias Gaertner :
> On Thu, 29 Oct 2009 15:00:53 +0200
> Graeme Geldenhuys wrote:
>
>> Hi,
>>
>> Do I create a memory leak if I cast a PChar it a AnsiString. Then
>> append text to the AnsiString and then cast it back to the original
>> PChar?
>>
>> eg:
>> var
>> Text: Pchar; <--
On Thu, 29 Oct 2009 15:00:53 +0200
Graeme Geldenhuys wrote:
> Hi,
>
> Do I create a memory leak if I cast a PChar it a AnsiString. Then
> append text to the AnsiString and then cast it back to the original
> PChar?
>
> eg:
> var
> Text: Pchar;<-- global var containing text.
>
> procedure
Graeme Geldenhuys schreef:
The reason why I'm not sure, is because I created a simple console
test application. Initially, running the program, I got the correct
output. Then I thought I would enable 'heaptrc' (-gh compiler
parameter) to make sure I am not leaking memory in the application.
Now w
2009/10/29 Graeme Geldenhuys :
> Hi,
>
> Do I create a memory leak if I cast a PChar it a AnsiString. Then
> append text to the AnsiString and then cast it back to the original
> PChar?
>
> eg:
> var
> Text: Pchar; <-- global var containing text.
>
> procedure AppendText(const AText: string);
>
On Thursday 29 October 2009 14:00:53 Graeme Geldenhuys wrote:
> Hi,
>
> Do I create a memory leak if I cast a PChar it a AnsiString. Then
> append text to the AnsiString and then cast it back to the original
> PChar?
>
> eg:
> var
> Text: Pchar;<-- global var containing text.
>
> procedure Ap
On 29/10/2009, Graeme Geldenhuys wrote:
>
> Without heaptrc enabled
> tmp $ ./project1
> t=hello
> Text=hello
> Text=hello world
Crap, I forgot to explain the output.
t: string;
Text: PChar
The last line is the result of Text after AppendText() was called.
A
Graeme Geldenhuys wrote:
Hi,
Do I create a memory leak if I cast a PChar it a AnsiString. Then
append text to the AnsiString and then cast it back to the original
PChar?
eg:
var
Text: Pchar;<-- global var containing text.
procedure AppendText(const AText: string);
var
s: string;
begin
On Thu, 29 Oct 2009 15:00:53 +0200
Graeme Geldenhuys wrote:
> Hi,
>
> Do I create a memory leak if I cast a PChar it a AnsiString. Then
> append text to the AnsiString and then cast it back to the original
> PChar?
>
> eg:
> var
> Text: Pchar;<-- global var containing text.
>
> procedure
The reason why I'm not sure, is because I created a simple console
test application. Initially, running the program, I got the correct
output. Then I thought I would enable 'heaptrc' (-gh compiler
parameter) to make sure I am not leaking memory in the application.
Now with heaptrc enabled, I get so
On Thu, Oct 29, 2009 at 14:00, Graeme Geldenhuys
wrote:
> Hi,
>
> Do I create a memory leak if I cast a PChar it a AnsiString. Then
> append text to the AnsiString and then cast it back to the original
> PChar?
>
> eg:
> var
> Text: Pchar; <-- global var containing text.
>
> procedure AppendTe
Hi,
Do I create a memory leak if I cast a PChar it a AnsiString. Then
append text to the AnsiString and then cast it back to the original
PChar?
eg:
var
Text: Pchar;<-- global var containing text.
procedure AppendText(const AText: string);
var
s: string;
begin
s := Text + AText;
Text
On 29/10/2009, Juha Manninen wrote:
>
> If done right, the code doing coordinate conversion should be in library
> Canvas class, not in application code.
That's how I would have implemented in it fpGUI as well. The higher
level code uses x, y as normal. The drawing backend code does
conversions
Hi,
> I'm making a simple GUI system for a game, and I needed to have screen
> origin independant input coordinates for the GUI (simpler to think about
> when using), and can be used in different world coordinate systems.
If done right, the code doing coordinate conversion should be in library
C
On Wed, 28 Oct 2009, Bruce Bauman wrote:
We are porting an application which needs to write to the system log via
syslog. We are running under Red Hat Enterprise Linux.
Is there an existing mechanism to do this, or do we need to interface to C code
ourselves?
TEventLog in the eventlog uni
fpc-pascal-boun...@lists.freepascal.org scritti il 29/10/2009 00.38.25
> We are porting an application which needs to write to the system log
> via syslog. We are running under Red Hat Enterprise Linux.
> Is there an existing mechanism to do this, or do we need to
> interface to C code ourselves?
30 matches
Mail list logo