Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetFileContentType2
#1
How can use http://mark0.net/code-tridlib-e.html in QM?
#2
the samples zip contains declarations of the dll functions and constants in VB6. Convert them to QM.
#3
declarations
Macro __trid
Code:
Copy      Help
;Constants FOR TrID_GetInfo
def TRID_GET_RES_NUM 1
def TRID_GET_RES_FILETYPE 2
def TRID_GET_RES_FILEEXT 3
def TRID_GET_RES_POINTS 4

def TRID_GET_VER 1001
def TRID_GET_DEFSNUM 1004

;Additional constants for the full version
def TRID_GET_DEF_ID 100
def TRID_GET_DEF_FILESCANNED 101
def TRID_GET_DEF_AUTHORNAME 102
def TRID_GET_DEF_AUTHOREMAIL 103
def TRID_GET_DEF_AUTHORHOME 104
def TRID_GET_DEF_FILE 105
def TRID_GET_DEF_REMARK 106
def TRID_GET_DEF_RELURL 107
def TRID_GET_DEF_TAG 108
def TRID_GET_DEF_MIMETYPE 109

def TRID_GET_ISTEXT 1005

;Functions
dll tridlib
,#TrID_LoadDefsPack $sPath
,#TrID_SubmitFileA $sFileName
,#TrID_Analyze
,#TrID_GetInfo lInfoType lInfoIdx $sTrIDRes
#4
sample
Macro trid sample
Code:
Copy      Help
out
str sFile="$qm$\qm.exe"

#compile __trid

if(!TrID_LoadDefsPack(_s.expandpath("$qm$"))) end ES_FAILED ;;assume TrIDDefs.TRD is in qm folder
if(!TrID_SubmitFileA(_s.expandpath(sFile))) end ES_FAILED
if(!TrID_Analyze) end ES_FAILED
str buf.all(260 2 0) s
int i r=TrID_GetInfo(TRID_GET_RES_NUM,0,buf)
;out r
for i 1 r+1
,TrID_GetInfo(TRID_GET_RES_FILETYPE,i,buf); s=buf.lpstr
,out "File type: %s",s
,TrID_GetInfo(TRID_GET_RES_FILEEXT,i,buf); s=buf.lpstr
,out "File ext: .%s",s
,r=TrID_GetInfo(TRID_GET_RES_POINTS,i,buf)
,out "Matching points: %d[]",r
#5
Thanks.


Forum Jump:


Users browsing this thread: 1 Guest(s)