Encerra a conexão com uma DLL (Dynamic-link library , ou Biblioteca de vinculo dinâmica).
Sintaxe
ExecInDllClose( < nHandle > )
Parâmetros
Nome | Tipo | Descrição | Obrigatório | Referência |
|---|---|---|---|---|
nHandle | numérico | Indica o handle da DLL obtida através da função ExecInDLLOpen(). | X |
|
Exemplos
extern "C" __declspec(dllexport) void ExecInClientDLL(int ID, char * Buf, char * Buf2, int nBuf2)
{
if(ID==1)
{
strcpy(Buf2,"Retorno opção 01");
}
else if (ID == 2)
{
strcpy(Buf2, "Retorno opção 02");
}
}
User Function Exemplo()
Local hHdl := 0,buffer := "",xRet1 := 0
// Abre Dll
hHdl := ExecInDLLOpen( "TSTDLL.DLL" )
// ----------------------------------------------------------------
// Envia comando para execução, repare que estamos
// usando a opção "1" no momento de chamar a DLL.
// ----------------------------------------------------------------
// ExecInDllRun não retorna valor da DLL
buffer:= "Executando a partir da ExecInDllRun..."
xRet1 := ExecInDllRun( hHdl, 1, @buffer )
alert("Retorno da ExecInDllRun: " + xRet1)
// ExeDllRun2 retorna valor numérico da DLL
buffer:= "Executando a partir da ExeDllRun2..."
nRet2 := ExeDllRun2( hHdl, 1, @buffer )
alert("Retorno da ExeDllRun2: " + StrZero(nRet2,3))
// ----------------------------------------------------------------
// Fecha a DLL
ExecInDllClose( hHdl )
Return
Preview
Veja também
Import HTML Content
Visão Geral
Conteúdo das Ferramentas