Posts: 864
Threads: 197
Joined: Apr 2005
Posts: 12,272
Threads: 144
Joined: Dec 2002
the samples zip contains declarations of the dll functions and constants in VB6. Convert them to QM.
Posts: 12,272
Threads: 144
Joined: Dec 2002
declarations
Macro
__trid
;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
Posts: 12,272
Threads: 144
Joined: Dec 2002
sample
Macro
trid sample
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
Posts: 864
Threads: 197
Joined: Apr 2005