Bom dia!
Estou fazendo alguns experimentos e gostaria de saber se existe alguma maneira de chamar funções de uma DLL, usando o nome longo da função ?
Pergunto isto, pois o clipper tem aquela limitação de 8 caracteres e etc...
As funções da DLL começam com um nome único, por exemplo: "NomeDaClasseBaseDaFuncao_<nome da função>".
Obs: Estou usando o FW24 junto.
Chamando funções com nome longo de uma DLL
Moderador: Moderadores
-
Kapiaba
- Colaborador

- Mensagens: 1908
- Registrado em: 07 Dez 2012 16:14
- Localização: São Paulo
- Contato:
Chamando funções com nome longo de uma DLL
Código: Selecionar todos
// Many thanks to Jim Gale for his superb feed-back
#include "FiveWin.ch"
#include "struct.ch"
//------------------------------------------------------------------------//
function Main()
local cLongName := Space( 256 )
local nNamePos := 0
local hFile
lMkDir( "this is a long name directory" )
LCreat( "this is a long filename file" )
MsgInfo( GetFullPathName( "thisis~1", Len( cLongName ),;
@cLongName, @nNamePos ) )
MsgInfo( cLongName )
MsgInfo( nNamePos ) // this returns an invalid value
MsgInfo( "LongName: " + GetLongFileName( "thisis~1" ) )
hFile = FOpen( "tutor01.prg" )
FCommit( hFile )
FClose( hFile )
MsgInfo( "ok" )
return nil
//------------------------------------------------------------------------//
function GetLongFileName( cShortName )
local oWin32FindData
STRUCT oWin32FindData
MEMBER nFileAttributes AS DWORD
MEMBER nCreationTime AS STRING LEN 8
MEMBER nLastReadAccess AS STRING LEN 8
MEMBER nLastWriteAccess AS STRING LEN 8
MEMBER nSizeHight AS DWORD
MEMBER nSizeLow AS DWORD
MEMBER nReserved0 AS DWORD
MEMBER nReserved1 AS DWORD
MEMBER cFileName AS STRING LEN 260
MEMBER cAltName AS STRING LEN 14
ENDSTRUCT
FindFirstFile( cShortName, oWin32FindData:cBuffer )
return oWin32FindData:cFileName
//------------------------------------------------------------------------//
DLL32 Function GetFullPathName( lpszFile AS LPSTR, cchPath AS DWORD,;
lpszPath AS LPSTR, @nFilePos AS PTR ) AS DWORD ;
PASCAL FROM "GetFullPathNameA" LIB "kernel32.dll"
DLL32 FUNCTION FindFirstFile( cFile AS LPSTR, cWin32DataInfo AS LPSTR ) ;
AS LONG PASCAL FROM "FindFirstFileA" LIB "kernel32.dll"
//------------------------------------------------------------------------//

