Preciso de uma dll(chron32.dll)da impressora.Como posso usa?
06/07/2004
0
Estou precisando usar a dll chron32.dll da impressora de preenchimeneto de cheques cronos para que minha aplicação gerencie. como posso fazer para usa-la.
Se alguém puder me ajudar?
Se alguém puder me ajudar?
Harlei
Curtir tópico
+ 0
Responder
Posts
06/07/2004
Sandra
harlei,
Veja se esta página que achei no Google pode lhe auxiliar: [url=http://www.chronos.com.br/]Chronos[/url].
Veja se esta página que achei no Google pode lhe auxiliar: [url=http://www.chronos.com.br/]Chronos[/url].
Responder
07/07/2004
Sam
Amigão, após ter pego as dll´s no site da Chronos, utilize os códigos abaixo:
//Função da Dll que abre a Porta Serial FUNCTION Plus_AbreX(IdPorta, Velocidade, Paridade, DataBits, StopBits: integer):integer; stdcall; external ´CHRON32.DLL´ name ´PLUS_AbreEx´; //Função da Dll que Especifica campo a ser impresso FUNCTION Plus_CampoCheque(IdPorta: integer; Campo: integer; ValorCampo: string): integer; stdcall; external ´CHRON32.DLL´ name ´PLUS_CampoCheque´; //Função da Dll que Imprime o cheque FUNCTION Plus_ImprimeCheque(IdPorta: integer):integer; stdcall; external ´CHRON32.DLL´ name ´PLUS_ImprimeCheque´; //Função da Dll que fecha a Porta Serial FUNCTION Plus_Fecha(IdPorta: integer):integer; stdcall; external ´CHRON32.DLL´ name ´PLUS_Fecha´; //Função da Dll que ejeta o Cheque FUNCTION Plus_Ejeta(IdPorta: integer):integer; stdcall; external ´CHRON32.DLL´ name ´PLUS_Ejeta´; //Função da Dll que programa bancos FUNCTION Plus_ProgramaBancos(idPorta: integer; idBanco: integer; banco: string): integer; stdcall; external ´CHRON32.dll´ name ´PLUS_ProgramaBancos´; procedure TF_Cheque.ImprimeCheque; var Retorno: Integer; Porta: Integer; Velocidade: Integer; Paridade: Integer; DataBits: Integer; StopBits: Integer; cBanco : integer; nBanco : string; begin if RadioButton3.Checked = true then begin Porta := 1; end; if RadioButton4.Checked = true then begin Porta := 2; end; if RadioButton5.Checked = true then begin Porta := 3; end; if RadioButton6.Checked = true then begin Porta := 4; end; cbanco := strToInt(Copy(ListBox2.Items[ListBox2.itemindex],1,3)); nBanco := Copy(ListBox2.Items[ListBox2.itemindex],5,20); Velocidade := 9600; Paridade := 0; DataBits := 8; StopBits := 1; ShowMessage(´Favorecido: ´ + DataModule.TabChequeFavorecido.text+13+´Porta: ´+intToStr(porta)+´ Banco: ´+intToStr(cBanco)+´-´+nBanco + 13 + ´Posicione o Cheque na Impressora, Tecle Enter´); // Abre porta COM1 Retorno := PLUS_AbreX(Porta, Velocidade, Paridade, DataBits, StopBits); if Retorno = 0 then ShowMessage( ´Erro ao abrir a porta. Verifique !´ ) else begin // Envia Codigo Banco Retorno := PLUS_ProgramaBancos(Porta, cBanco , nBanco); if Retorno = 0 then ShowMessage(´Erro na Programação do Banco !´) else begin // Envia Favorecido if DataModule.TabChequeTipoCheque.Value = ´NOMINAL´ then begin Retorno := PLUS_CampoCheque(Porta, 0 , DataModule.TabChequeFavorecido.text); end else begin Retorno := PLUS_CampoCheque(Porta, 0 ,´_´); end; if Retorno = 0 then ShowMessage(´Erro no Envio do Favorecido !´) else begin // Envia Localidade Retorno := PLUS_CampoCheque(Porta, 1 , DataModule.TabChequeCidade.text); if Retorno = 0 then ShowMessage(´Erro no Envio da Localidade !´) else begin // Envia Banco Retorno := PLUS_CampoCheque(Porta, 2 , nbanco); if Retorno = 0 then ShowMessage(´Erro no Envio do Banco !´) else begin // Envia Valor Retorno := PLUS_CampoCheque(Porta, 3 , FormatFloat(´0.00´,DataModule.TabChequeValor.value)); if Retorno = 0 then ShowMessage(´Erro no Envio do Valor !´) else begin // Envia Data de Emissão Retorno := PLUS_CampoCheque(Porta, 4 , FormatDateTime(´DD/MM/YY´,DataModule.TabChequeDataEmissao.value)); if Retorno = 0 then ShowMessage(´Erro no envio da Data de Emissão !´) else begin // Envia Campo Extra Retorno := PLUS_CampoCheque(Porta, 99 , ´_´); if Retorno = 0 then ShowMessage(´Erro no envio do Campo Extra !´) else begin // Imprime o Cheque Retorno := PLUS_ImprimeCheque(Porta); if Retorno = 0 then ShowMessage(´Erro na Impressão do Cheque´); end; end; end; end; end; end; end; end; Retorno := PLUS_Ejeta(Porta); if Retorno = 0 then ShowMessage( ´Erro ao Ejetar o Documento. Verifique !´ ); Retorno := PLUS_Fecha(Porta); if Retorno = 0 then ShowMessage( ´Erro ao Fechar a porta. Verifique !´ ); end;
Responder
Clique aqui para fazer login e interagir na Comunidade :)