9 May
                
                    2007
                
            
            
                9 May
                
                '07
                
            
            
            
        
    
                3:53 p.m.
            
        currentLayer is the correct way to find the currently active layer for a view; layers are just SPItemGroups, which are SPItems themselves, so you should be able to use SPItem methods like setExplicitlyHidden.
For now, the proper way to downcast SPObject * to SPItem * is to use the SP_ITEM() macro -- be sure to test whether it returns NULL however (in the [unusual, but possible] case when the object was not an SPItem).
-mental