Click here to Skip to main content
16,005,339 members
Home / Discussions / C#
   

C#

 
AnswerRe: More Efficient Code Pin
therealmccoy22-Sep-05 7:03
therealmccoy22-Sep-05 7:03 
AnswerRe: More Efficient Code Pin
Robert Rohde22-Sep-05 8:06
Robert Rohde22-Sep-05 8:06 
GeneralRe: More Efficient Code Pin
Niklas Ulvinge22-Sep-05 8:51
Niklas Ulvinge22-Sep-05 8:51 
GeneralRe: More Efficient Code Pin
Robert Rohde22-Sep-05 9:05
Robert Rohde22-Sep-05 9:05 
GeneralRe: More Efficient Code Pin
Debs*22-Sep-05 10:30
Debs*22-Sep-05 10:30 
GeneralRe: More Efficient Code Pin
Niklas Ulvinge23-Sep-05 0:42
Niklas Ulvinge23-Sep-05 0:42 
AnswerRe: More Efficient Code -SOLVED Pin
Debs*23-Sep-05 7:11
Debs*23-Sep-05 7:11 
QuestionIEnumIDList.Next(...) is not working :( Pin
daouner22-Sep-05 5:28
daouner22-Sep-05 5:28 
Hello!

Ihave extendended the ShellLib (from arikp's article) to support the IEnumIDList interface. Here is the code:

<br />
        [ComImport]<br />
	[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]<br />
	[Guid("000214F2-0000-0000-C000-000000000046")]<br />
	public interface IEnumIDList<br />
	{<br />
		[PreserveSig]<br />
		Int32 Clone(out IntPtr ppenum);<br />
<br />
		[PreserveSig]<br />
		Int32 Next(UInt32 celt, <br />
			[MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)]<br />
			out IntPtr[] rgelt,<br />
			out UInt32 pceltFetched<br />
			);<br />
<br />
		[PreserveSig]<br />
		Int32 Reset();<br />
<br />
		[PreserveSig]<br />
		Int32 Skip(UInt32 celt);<br />
	}<br />

and I get an instance of this interface using:
<br />
                public static IEnumIDList GetEnumIDList(IntPtr ptrEnumIDList)<br />
		{<br />
			System.Type shellEnumIDListType =                      System.Type.GetType("ShellLib.IEnumIDList");<br />
			Object obj = Marshal.GetTypedObjectForIUnknown(ptrEnumIDList, shellEnumIDListType);<br />
			IEnumIDList RetVal = (IEnumIDList)obj;<br />
			return RetVal;<br />
		}<br />

If I try this code:
<br />
                        UInt32 celt = 10;<br />
			IntPtr[] ptrList = new IntPtr[celt];<br />
			UInt32 count;<br />
                        EnumIDList.Next(celt, out ptrList, out count)<br />

The Shell dosen't fill the ptrList and count is 0. The IShellFolder is the Desktop folder.
<br />
                IntPtr ptrFoldersList;<br />
		iDesktopFolder.EnumObjects(this.Handle, (Int32)ShellApi.SHCONTF.SHCONTF_FOLDERS | (Int32)ShellApi.SHCONTF.SHCONTF_STORAGE, out ptrFoldersList);<br />


If you need any details please let me know. I don't really see what I did wrong... (maybe I'm dumb Smile | :) ).

Thank you!
AnswerRe: IEnumIDList.Next(...) is not working :( Pin
Heath Stewart22-Sep-05 6:29
protectorHeath Stewart22-Sep-05 6:29 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
daouner22-Sep-05 7:25
daouner22-Sep-05 7:25 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
daouner22-Sep-05 10:00
daouner22-Sep-05 10:00 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
Heath Stewart22-Sep-05 11:06
protectorHeath Stewart22-Sep-05 11:06 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
daouner23-Sep-05 7:19
daouner23-Sep-05 7:19 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
Heath Stewart23-Sep-05 7:27
protectorHeath Stewart23-Sep-05 7:27 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
daouner23-Sep-05 7:34
daouner23-Sep-05 7:34 
GeneralRe: IEnumIDList.Next(...) is not working :( Pin
daouner23-Sep-05 9:08
daouner23-Sep-05 9:08 
QuestionRegular Expression for html tags Pin
brunoconde22-Sep-05 5:15
brunoconde22-Sep-05 5:15 
AnswerRe: Regular Expression for html tags Pin
Guffa22-Sep-05 6:14
Guffa22-Sep-05 6:14 
GeneralRe: Regular Expression for html tags Pin
Anonymous22-Sep-05 8:36
Anonymous22-Sep-05 8:36 
Questionhow to use the AdRotator?? Pin
shanzy22-Sep-05 4:50
shanzy22-Sep-05 4:50 
AnswerRe: how to use the AdRotator?? Pin
shanzy22-Sep-05 5:28
shanzy22-Sep-05 5:28 
AnswerRe: how to use the AdRotator?? Pin
Dave Kreskowiak22-Sep-05 8:12
mveDave Kreskowiak22-Sep-05 8:12 
Questiontrapping hotkey Pin
Sabry190522-Sep-05 4:21
Sabry190522-Sep-05 4:21 
AnswerRe: trapping hotkey Pin
Mridang Agarwalla22-Sep-05 4:36
Mridang Agarwalla22-Sep-05 4:36 
QuestionChange windows system time Pin
djvando22-Sep-05 4:18
djvando22-Sep-05 4:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.