Recent

Author Topic: shlobj.pp SHStartNetConnectionDialogA problem  (Read 240 times)

440bx

  • Hero Member
  • *****
  • Posts: 6121
shlobj.pp SHStartNetConnectionDialogA problem
« on: September 15, 2025, 05:17:15 am »
Hello,

shlobj.pp defines the following:
Code: Pascal  [Select][+][-]
  1.   function SHStartNetConnectionDialogA(hwnd:HWND; pszRemoteName:lpcstr; dwType:DWord):HRESULT;StdCall;external External_library name 'SHStartNetConnectionDialogA';
  2.   function SHStartNetConnectionDialogW(hwnd:HWND; pszRemoteName:lpcwstr; dwType:DWord):HRESULT;StdCall;external External_library name 'SHStartNetConnectionDialogW';
  3.  
The problem is the _named_ function SHStartNetConnectionDialogA  does _not_ exist from WinXP onwards.  A program that statically uses that function will fail to load.

The "W" entry point does exist.

FYI: SHStartNetConnectionDialogA is available as ordinal 12 (unnamed and undocumented) from Win XP to Win 11.

It would probably be indicated to remove SHStartNetConnectionDialogA  or at least put a comment that the function is not available from Win XP onwards and to use the "W" version instead since that one is available.

HTH.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018