Recent

Author Topic: Noob Question about Librarys  (Read 15262 times)

ivan17

  • Full Member
  • ***
  • Posts: 173
Re: Noob Question about Librarys
« Reply #15 on: December 06, 2010, 09:20:37 pm »
Thank you for all the answer's
But when should I use stdcall?

when your function (from dll) is to be called from a c-like language you can not use the pascal default (and superior) calling convention; you use cdecl or stdcall (not the same thing) instead.

captian jaster

  • Guest
Re: Noob Question about Librarys
« Reply #16 on: December 08, 2010, 03:30:17 am »
Thank you for all the answer's
But when should I use stdcall?

when your function (from dll) is to be called from a c-like language you can not use the pascal default (and superior) calling convention; you use cdecl or stdcall (not the same thing) instead.
Not the same thing..
Exactly..
How do I know when to use which?

cdbc

  • Hero Member
  • *****
  • Posts: 2600
    • http://www.cdbc.dk
Re: Noob Question about Librarys
« Reply #17 on: December 08, 2010, 06:12:09 am »
Hi

The "stdcall" calling convention is mainly windows-centric...

hth - Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Laksen

  • Hero Member
  • *****
  • Posts: 802
    • J-Software
Re: Noob Question about Librarys
« Reply #18 on: December 08, 2010, 09:48:37 am »
You should use stdcall whenever what you're calling is declared with stdcall :)

The Windows API is mostly declared with stdcall on win32, but when you call C/C++ code, it's cdecl by default(unless they've manually changed it to something else)

captian jaster

  • Guest
Re: Noob Question about Librarys
« Reply #19 on: December 08, 2010, 08:35:59 pm »
You should use stdcall whenever what you're calling is declared with stdcall :)

The Windows API is mostly declared with stdcall on win32, but when you call C/C++ code, it's cdecl by default(unless they've manually changed it to something else)
Thank you  :D

 

TinyPortal © 2005-2018