Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-05

GetCurrentThreadID to string

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

How do I convert the GetCurrentThreadID() result to a string?

At the moment for Linux and Windows the following works:

  var
    lsThreadID: string
  begin
    lsThreadID := IntToStr(GetCurrentThreadID);

But under Mac OS the above code gives me the following error:

Error:
Incompatible type for arg no. 1: Got "Pointer", expected "QWord"

Now I could use PtrInt or Format(), but that means I have to IFDEF the code for Mac OS which I would rather want to prevent. I don't like distributing IFDEFs in my code. Is there some "safe" way of doing this that will work for all supported platforms?

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Vinzent Höfler
to Graeme Geldenhuys: How do I convert the GetCurrentThreadID() result to a string? At the moment for Linux and…

Graeme Geldenhuys :

Show quoted text 8 lines
How do I convert the GetCurrentThreadID() result to a string? At the moment for Linux and Windows the following works: var lsThreadID: string begin lsThreadID := IntToStr(GetCurrentThreadID);
lsThreadID := SysUtils.IntToStr (QWord(GetCurrentThreadID));

?

Vinzent.

Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dslspecial.gmx.de/freedsl-aktionspreis/?ac=OM.AD.PD003K11308T4569a

Reply by email