When you reverse-engineer and then regenerate a PowerBuilder application, an external function with a case-sensitive name such as GetCurrentDirectoryW fails. The workaround is to specify an alias for the function, for example:
public function ulong GetCurrentDirectoryW (ulong textlen, ref string dirtext) library "KERNEL32.dll" alias for "GetCurrentDirectoryW"
[CR 358442]