import com.interface.IShellItem;
import com.interface;

namespace com.interface;

class IEnumShellItems {
    ctor(){
		this = ..com.interface.IUnknown(); 
	};  
	pointer Next = "int(INT celt,ptr &rgelt,INT &celtFetched)"; 
	pointer Skip = "int(INT ulCount)";
	pointer Reset = "int()";
	pointer Clone = "int(ptr ppEnum)";
	each = function(){
		// owner才是当前com对象,this指向的是接口定义
		var this = owner;
		
		return function(){ 
    		var hr,pItem,celtFetched = this.Next(1,null,0); 
    		if( (hr>=0/*_SUCCEEDED*/) && celtFetched){  
    			var item = ..com.interface(pItem,..com.interface.IShellItem);
    		}
    	} ; 
	}
}

namespace IEnumShellItems{
    IID = "{70629033-e363-4a28-a567-0db78006e6d7}" 
}