[R] Comment envoyer un parametre NULL avec DllCall ?
Posté : mar. 20 avr. 2010 20:56
Bonsoir, je n'arrive pas a faire fonctionner un DllCall
La fonction :
l'aide de la fonction de la dll :
Cette fonction liste les éléments html trouvé suivant les paramètres, si je met les 3 paramètres (le tag, l'attribut et la valeur de l'attribut html) ca marche.
si je veu lister les tags sans attribut ca ne marche plus.
je suppose que DllCall ne reconnait pas "" comme NULL.
il y a bien évidemment une balise div présente dans mon code html.
Si quelqu'un a une idée, je suis preneur
La fonction :
Code : Tout sélectionner
Func _HLVisitElements($dll, $el, $CallBackFunc, $TagName = "", $AttributeName = "", $AttributeValue = "",$depth = 0)
$handle = DLLCallbackRegister ($CallBackFunc, "BOOL","ptr;ptr")
$result = DllCall($dll, "int", "HTMLayoutVisitElements","ptr",$el,"str",$TagName,"str",$AttributeName,"wstr",$AttributeValue,"ptr",DllCallbackGetPtr($handle),"ptr","","DWORD",$depth)
DllCallbackFree($handle)
If @error Then Return -1
Return 1
EndFuncCode : Tout sélectionner
EXTERN_C HLDOM_RESULT HLAPI HTMLayoutVisitElements ( HELEMENT he,
LPCSTR tagName,
LPCSTR attributeName,
LPCWSTR attributeValue,
HTMLayoutElementCallback * callback,
LPVOID param,
DWORD depth
)
Call specified function for every element in a DOM that meets specified criteria.
Parameters:
[in] he HELEMENT
[in] tagName LPCSTR, comma separated list of tag names to search, e.g. "div", "p", "div,p" etc. Can be NULL.
[in] attributeName LPCSTR, name of attribute, can contain wildcard characters, see below. Can be NULL.
[in] attributeValue LPCWSTR, value of attribute, can contain wildcard characters, see below. Can be NULL.
[in] callback HTMLayoutElementCallback*, address of callback function being called on each element found.
[in] param LPVOID, additional parameter to be passed to callback function.
[in] depth DWORD, depth - depth of search. 0 means all descendants, 1 - direct children only, 2 - children and their children and so on.
si je veu lister les tags sans attribut ca ne marche plus.
Code : Tout sélectionner
_HLVisitElements($dll, $root, "_test", "li", "class", "selected",0) ;fonctionne
_HLVisitElements($dll, $root, "_test", "div", "", "",0) ;ne fonctionne pasil y a bien évidemment une balise div présente dans mon code html.
Si quelqu'un a une idée, je suis preneur