Exportfile for AOT version 1.0 or later Formatversion: 1 ***Element: JOB ; Navision Axapta Job: AXL_GDI_2 descargados en Viernes 08/07/2005 ; -------------------------------------------------------------------------------- JOBVERSION 1 SOURCE #AXL_GDI_2 #static void AXL_GDI_2 (Args _args) #{ # DLL dll; # DLLFunction dllFunction; # DLLFunction _StartDocA; # DLLFunction _StartPage; # DLLFunction _textOut; # DLLFunction _endpage; # DLLFunction _EndDoc; # DLLFunction _DeleteDC; # DLLFunction _CreateFontIndirectA; # DLLFunction _SelectObject; # # str hprintdc; # str result; # str outstr; # str lf; # # int i ,x ,y; # # //Private Type LOGFONT # Binary LogFont = new binary(68); # Binary lfHeight = new binary(4); // lfHeight As Long # Binary lfWidth = new binary(4); // lfWidth As Long # Binary lfEscapement = new binary(4); // lfEscapement As Long # Binary lfOrientation = new binary(4); // lfOrientation As Long # Binary lfWeight = new binary(4); // lfWeight As Long # Binary lfItalic = new binary(1); // lfItalic As Byte # Binary lfUnderline = new binary(1); // lfUnderline As Byte # Binary lfStrikeOut = new binary(1); // lfStrikeOut As Byte # Binary lfCharSet = new binary(1); // lfCharSet As Byte # Binary lfOutPrecision = new binary(1); // lfOutPrecision As Byte # Binary lfClipPrecision = new binary(1); // lfClipPrecision As Byte # Binary lfQuality = new binary(1); // lfQuality As Byte # Binary lfPitchAndFamily = new binary(1); // lfPitchAndFamily As Byte # Binary lfFaceName = new binary(40); // lfFaceName As String * LF_FACESIZE # # //Private Type DOCINFO # #define.STRUCTSIZE(20) # Binary struct; # binary lpszDocName = new binary(50); # Binary lpszOutput = new binary(50); # Binary lpszDatatype = new binary(50); # ; # lpszDocName.string(0,'lpszDocName'); # lpszOutput.string(0,''); # lpszDatatype.string(0,''); # # //Private Type DOCINFO # struct = new Binary(#STRUCTSIZE); # struct.dWord(0); // cbSize As Long # struct.binary(4,lpszDocName); // lpszDocName As String # struct.binary(8,lpszOutput); // lpszOutput As String # struct.binary(12,lpszDatatype); // lpszDatatype As String # struct.dWord(16); // fwType As Long # # dll = new DLL('gdi32.dll'); # dllFunction = new DLLFunction(dll,'CreateDCA'); # dllFunction.arg(ExtTypes::String); # dllFunction.arg(ExtTypes::String); # dllFunction.arg(ExtTypes::DWord); # dllFunction.arg(ExtTypes::DWord); # dllFunction.returns(ExtTypes::DWord); # # _StartDocA = new DLLFunction(dll,'StartDocA'); # _StartDocA.arg(ExtTypes::DWord); # _StartDocA.arg(ExtTypes::Pointer); # _StartDocA.returns(ExtTypes::DWord); # # _StartPage = new DLLFunction(dll,'StartPage'); # _StartPage.arg(ExtTypes::DWord); # _StartPage.returns(ExtTypes::DWord); # # _textOut = new DLLFunction(DLL, 'TextOutA'); # _textOut.returns(ExtTypes::DWORD); # _textOut.arg(ExtTypes::DWORD, ExtTypes::DWORD, ExtTypes::DWORD, ExtTypes::STRING,ExtTypes::DWORD); # # _endpage = new DLLFunction(DLL, 'EndPage'); # _endpage.returns(ExtTypes::DWORD); # _endpage.arg(ExtTypes::DWORD); # # _EndDoc = new DLLFunction(DLL, 'EndDoc'); # _EndDoc.returns(ExtTypes::DWORD); # _EndDoc.arg(ExtTypes::DWORD); # # _DeleteDC = new DLLFunction(DLL, 'DeleteDC'); # _DeleteDC.returns(ExtTypes::DWORD); # _DeleteDC.arg(ExtTypes::DWORD); # # # // Private Declare Function CreateFontIndirect Lib "gdi32" Alias _ # // "CreateFontIndirectA" (lpLogFont As LOGFONT) As Long # _CreateFontIndirectA = new DLLFunction(DLL,'CreateFontIndirectA'); # _CreateFontIndirectA.returns(ExtTypes::DWORD); # _CreateFontIndirectA.arg(ExtTypes::Pointer); # # //Private Declare Function SelectObject Lib "gdi32" _ # //(ByVal hdc As Long, ByVal hObject As Long) As Long # _SelectObject = new DLLFunction(DLL,'SelectObject'); # _SelectObject.arg(ExtTypes::DWord); # _SelectObject.arg(ExtTypes::DWord); # _SelectObject.returns(ExtTypes::DWORD); # # // Set rotation in tenths of a degree, i.e., 450 = 45 degrees # lfEscapement.dWord(0,450); # lfHeight.dWord(0,12); # LogFont.binary(4,lfHeight); # LogFont.binary(8,lfEscapement); # lf = _CreateFontIndirectA.call(logfont); # # # //hprintdc = dllFunction.call('winspool', "LANIER 5635 PCL 5e",0,0); # //hprintdc = dllFunction.call('winspool','\\\\madrms01\\ESMAPL01',0,0); # hprintdc = dllFunction.call('winspool','Generic / Text Only (Copiar 1)',0,0); # # result = _StartDocA.call(hprintdc,struct); # result = _StartPage.call(hprintdc); # # lf = _SelectObject.call(hprintdc,lf); # For ( x = 0; x <= 40; x ++) # { # y = 2; # outstr = strfmt('%1', x); # _textOut.call(hPrintDc, x * 100, y * 100, outstr , strlen(outstr)); # } # For ( y = 0; y <= 40; y ++) # { # x = 2; # outstr = strfmt('%1', y); # _textOut.call(hPrintDc, x * 100, y * 100, outstr , strlen(outstr)); # } # # result = _endpage.call(hprintdc); # result = _EndDoc.call(hprintdc); # result = _DeleteDC.call(hprintdc); # # dll = null; # dllFunction = null; # _StartDocA= null; # _StartPage= null; # _textOut= null; # _endpage= null; # _EndDoc= null; # _DeleteDC= null; # _CreateFontIndirectA = null; # _SelectObject = null; # # pause; #} ENDSOURCE ***Element: END