- Code: Select all Expand view
DLL32 FUNCTION D_MFDINFOR(cIndice AS STRING, @cInfo AS STRING); //-- Samir 24/8/2009
AS _INT PASCAL FROM "Daruma_FIMFD_RetornaInformacao";
LIB nLib32
Call
- Code: Select all Expand view
****************************************************************************
METHOD PegaNumeroSerie() CLASS TFISPRN
****************************************************************************
*
* Obter o numero de serie da impressora
* Parametros:
* Retorno: nLastResult
*
* Autor: Samir
* 24/8/2009 - 14:11:51
*
****************************************************************************
Private cNumeroSerie := ""
cNumeroSerie := Space(15)
if ::EcfType == ecf_daruma
/*
if ::cModelo == "1" //-- Samir 14/9/2009
::nLastResult := D_NUMSERIE(@cNumeroSerie)
cNumeroSerie := SZero(cNumeroSerie,8)
Alert("Modelo 1")
else
*/
cNumeroSerie := Space(20) //-- Samir 30/9/2009
::nLastResult := D_MFDINFOR("78",@cNumeroSerie)
Alert("Modelo 2")
//end
//-- DadosVar = Function that use a MsgInfo to show the type, length and value of the var
DadosVar(cNumeroSerie,.T.,"cNumeroSerie parametro")
//-- Verify the success of the printer
If ::nLastResult = 1
Alert("CAIU")
Try//-- RemNaoImp, remove non-printables characters(Chr() 1 a 32) and apply PadR() to the var
::cNumeroSerie := RemNaoImp(cNumeroSerie,.T.)
catch
Msg("Erro!")
end
end
DadosVar(::cNumeroSerie,.T.,"::cNumeroSerie dados")
end
return ::nLastResult
/*------------------------------------------------------------------------*/
If I execute this proc, until now I had 6 different results:
- Return a text that isn't associated with the related and isn't instanced in this sequence in any place, in my case "Report X DAV "
- Return strange characters, such */+..~¨ 41
- Return empty
- Close abruptely the program without sending error message
- Close abruptely the program and request error sending to Windows
- Return the serial number of the printer
Someone knows how can I fix this? I'm trying to solve it for a few days, I need so much to solve it as soon as possible!