Dava pra melhorar muuuuito....
METHOD GetPath(tipo)
local hResult, buffer, bufferLen
bufferLen := STR_LEN
buffer := Space(bufferLen)
hResult := DllCall(::hHandle, DLL_OSAPI, "NFE_GetPath", tipo, @buffer, @bufferLen)
::CheckResult(hResult)
RETURN ::ProcessResult(buffer, bufferLen)
EM TUDO, tem a chamada, seguida da CheckResult, que nada mais é do que testar se o retorno cabia na variável, e se não couber cria uma variável maior.
ISSO É UMA CLASSE, parece que esqueceram.
Se é tudo igual, centraliza isso.
Substituir por a, b, c, d, e, f, g, o que poderia ser três pontos em Harbour ...
METHOD DllAcbr( cFunction, a, b, c, d, e, f, g )
LOCAL hResult, buffer, bufferlen
bufferlen := STR_LEN
buffer := Space( bufferlen )
hResult := DllCall( ::hHandle, DLL_OSAPI, cFunction, @a, @b, @c, @d, @e, @f, @g )
RETURN ::ProcessResult( buffer, bufferlen )
Com isso, o método original (todos fazem a mesma coisa), poderia ser resumido em:
METHOD GetPath( tipo ) INLINE ::DllAcbr( "NFE_GetPath", tipo )
Só pra dar uma idéia de possibilidades.