Jump to content

Search the Community

Showing results for tags 'winapigdi'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hi, I've a script, using WinAPIGdi, checking info on font files for some files, I get the error "C:\DEV\AutoIt3\Include\WinAPIGdi.au3" (2480) : ==> Variable must be of type "Object".: and then the script stops. Is there a way I can either "catch" that error, and let my script continue with the next file or improve something in the WinAPIGdi script? I've searched the forums on error handling, but couldn't immediately find something related tho errors like these which are hardstopping the script P.S. : I'm an AutoIT script newbie..... snippet from WinAPIGdi, line 2480 from the error is this one: $sResult = $tResult.szTTFName ; #FUNCTION# ==================================================================================================================== ; Author ........: funkey ; Modified ......: UEZ, jpm ; =============================================================================================================================== Func _WinAPI_GetFontMemoryResourceInfo($pMemory, $iFlag = 1) Local Const $tagTT_OFFSET_TABLE = "USHORT uMajorVersion;USHORT uMinorVersion;USHORT uNumOfTables;USHORT uSearchRange;USHORT uEntrySelector;USHORT uRangeShift" Local Const $tagTT_TABLE_DIRECTORY = "char szTag[4];ULONG uCheckSum;ULONG uOffset;ULONG uLength" Local Const $tagTT_NAME_TABLE_HEADER = "USHORT uFSelector;USHORT uNRCount;USHORT uStorageOffset" Local Const $tagTT_NAME_RECORD = "USHORT uPlatformID;USHORT uEncodingID;USHORT uLanguageID;USHORT uNameID;USHORT uStringLength;USHORT uStringOffset" Local $tTTOffsetTable = DllStructCreate($tagTT_OFFSET_TABLE, $pMemory) Local $iNumOfTables = _WinAPI_SwapWord(DllStructGetData($tTTOffsetTable, "uNumOfTables")) ;check is this is a true type font and the version is 1.0 If Not (_WinAPI_SwapWord(DllStructGetData($tTTOffsetTable, "uMajorVersion")) = 1 And _WinAPI_SwapWord(DllStructGetData($tTTOffsetTable, "uMinorVersion")) = 0) Then Return SetError(1, 0, "") Local $iTblDirSize = DllStructGetSize(DllStructCreate($tagTT_TABLE_DIRECTORY)) Local $bFound = False, $iOffset, $tTblDir For $i = 0 To $iNumOfTables - 1 $tTblDir = DllStructCreate($tagTT_TABLE_DIRECTORY, $pMemory + DllStructGetSize($tTTOffsetTable) + $i * $iTblDirSize) If StringLeft(DllStructGetData($tTblDir, "szTag"), 4) = "name" Then $bFound = True $iOffset = _WinAPI_SwapDWord(DllStructGetData($tTblDir, "uOffset")) ExitLoop EndIf Next If Not $bFound Then Return SetError(2, 0, "") Local $tNTHeader = DllStructCreate($tagTT_NAME_TABLE_HEADER, $pMemory + $iOffset) Local $iNTHeaderSize = DllStructGetSize($tNTHeader) Local $iNRCount = _WinAPI_SwapWord(DllStructGetData($tNTHeader, "uNRCount")) Local $iStorageOffset = _WinAPI_SwapWord(DllStructGetData($tNTHeader, "uStorageOffset")) Local $iTTRecordSize = DllStructGetSize(DllStructCreate($tagTT_NAME_RECORD)) Local $tResult, $sResult, $iStringLength, $iStringOffset, $iEncodingID, $tTTRecord For $i = 0 To $iNRCount - 1 $tTTRecord = DllStructCreate($tagTT_NAME_RECORD, $pMemory + $iOffset + $iNTHeaderSize + $i * $iTTRecordSize) If _WinAPI_SwapWord($tTTRecord.uNameID) = $iFlag Then ;1 says that this is font name. 0 for example determines copyright info $iStringLength = _WinAPI_SwapWord(DllStructGetData($tTTRecord, "uStringLength")) $iStringOffset = _WinAPI_SwapWord(DllStructGetData($tTTRecord, "uStringOffset")) $iEncodingID = _WinAPI_SwapWord(DllStructGetData($tTTRecord, "uEncodingID")) Local $sWchar = "char" If $iEncodingID = 1 Then $sWchar = "word" $iStringLength = $iStringLength / 2 EndIf $tResult = DllStructCreate($sWchar & " szTTFName[" & $iStringLength & "]", $pMemory + $iOffset + $iStringOffset + $iStorageOffset) If $iEncodingID = 1 Then $sResult = "" For $j = 1 To $iStringLength $sResult &= ChrW(_WinAPI_SwapWord(DllStructGetData($tResult, 1, $j))) Next Else $sResult = $tResult.szTTFName EndIf If StringLen($sResult) > 0 Then ExitLoop EndIf Next Return $sResult EndFunc ;==>_WinAPI_GetFontMemoryResourceInfo the function in my script: Func FontGetInfoFromFile($sFile, $n, $sElement) Local $s = _WinAPI_GetFontResourceInfo($sFile, Default, $n) If Not @error And $s Then ConsoleWrite($sElement & " = " & $s & @CRLF) If @error Then ConsoleWrite ("ERROR!!!") EndFunc ;==>FontGetInfoFromFile and _WinAPI_GetFontResourceInfo uses _WinAPI_GetFontMemoryResourceInfo as you know any help or hints are welcome Babylon5.ttf Bahamas.ttf
×
×
  • Create New...