Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does this code declare a DISTINCT type?

ShlObj.pas line 9922 (as in Delphi XE):

type
  BFFCALLBACK = function(Wnd: HWND; uMsg: UINT; lParam, lpData: LPARAM): Integer stdcall;
  TFNBFFCallBack = type BFFCALLBACK;
  {$EXTERNALSYM BFFCALLBACK}

Answering to David Heffernan's comment here because i think this outlines a relevant background for possible why do you ask this? question. Procedural types for callback routines of Windows API origin are declared as type aliases (you know, canonical API name + "Pascalised" alias, or vice versa sometimes). Examples are Windows.PIMAGE_TLS_CALLBACK, ShlObj.LPFNDFMCALLBACK et cetera. Type declaration shown above is an exception. Thats why i'm asking :-)

like image 421
OnTheFly Avatar asked Apr 26 '26 21:04

OnTheFly


1 Answers

It is just a way to force us programmers to use TFNBFFCallBack instead of BFFCALLBACK. If it was an alias we could use either for the browse info structure. On a different platform TFNBFFCallBack could point to something different than BFFCALLBACK.

like image 115
Kit Fisto Avatar answered Apr 29 '26 11:04

Kit Fisto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!