Olá

Alguém sabe o que pode estar dando de errado nessa chamada de DLL?

 

implementation

 

function get_receipt (login,senha, msgid :string; var
telefone,conteudo,dtpedido,dtentrega,status,descricao:string): integer;
stdcall; external 'Teste.dll';

 

{$R *.dfm}

 

procedure TForm1.Button2Click(Sender: TObject);

var I : integer;

begin

  I := get_receipt (‘teste’,’senha’, ‘1’ :string; var
telefone,conteudo,dtpedido,dtentrega,status,descricao:string);

eng;

 

Se eu faço da maneira acima da sempre access violation na 3 vez que chamo a
função via DLL. Mas o mais estranho é que se eu trago a função que está na
DLL para dentro do código-fonte e funciona 100%!!!!

Na minha dll o código está correto...

 

library DLL;

 

{ Important note about DLL memory management: ShareMem must be the

  first unit in your library's USES clause AND your project's (select

  Project-View Source) USES clause if your DLL exports any procedures or

  functions that pass strings as parameters or function results. This

  applies to all strings passed to and from your DLL--even those that

  are nested in records and classes. ShareMem is the interface unit to

  the BORLNDMM.DLL shared memory manager, which must be deployed along

  with your DLL. To avoid using BORLNDMM.DLL, pass string information

  using PChar or ShortString parameters. }

 

uses

  SysUtils,

  ECXMLParser, IEHTTP3, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient,

  IdHTTP, Classes;

 

 

{$R *.res}

 

function get_receipt(login, password, msgid: string; var bnumber, text,
sentdate, deliverydate, msgstatus, description: string): integer;stdcall;

 

….

 

 

end;

end.

 

Alguém sabe porque esta dando access violation se eu chamo via dll? Porque
com a função dentro do aplicativo funciona sem problemas.

Abraços

 

 

 



[As partes desta mensagem que não continham texto foram removidas]



-- 
<<<<< FAVOR REMOVER ESTA PARTE AO RESPONDER ESTA MENSAGEM >>>>>

Para ver as mensagens antigas, acesse:
 http://br.groups.yahoo.com/group/delphi-br/messages

Para falar com o moderador, envie um e-mail para:
 [EMAIL PROTECTED] ou [EMAIL PROTECTED]
 
Links do Yahoo! Grupos

<*> Para visitar o site do seu grupo na web, acesse:
    http://br.groups.yahoo.com/group/delphi-br/

<*> Para sair deste grupo, envie um e-mail para:
    [EMAIL PROTECTED]

<*> O uso que você faz do Yahoo! Grupos está sujeito aos:
    http://br.yahoo.com/info/utos.html

 


Responder a