Click here to Skip to main content
15,905,781 members
Home / Discussions / COM
   

COM

 
GeneralHelp!! - "both" components Pin
LasVegasGuy8-Feb-04 9:10
LasVegasGuy8-Feb-04 9:10 
GeneralRe: Help!! - "both" components Pin
Nick Parker8-Feb-04 10:30
protectorNick Parker8-Feb-04 10:30 
GeneralRe: Help!! - "both" components Pin
LasVegasGuy8-Feb-04 10:34
LasVegasGuy8-Feb-04 10:34 
GeneralRe: Help!! - "both" components Pin
Anonymous8-Feb-04 12:09
Anonymous8-Feb-04 12:09 
GeneralRe: Help!! - "both" components Pin
LasVegasGuy8-Feb-04 12:14
LasVegasGuy8-Feb-04 12:14 
GeneralRe: Help!! - "both" components Pin
Anonymous8-Feb-04 18:56
Anonymous8-Feb-04 18:56 
GeneralRe: Help!! - "both" components Pin
Anonymous9-Feb-04 8:33
Anonymous9-Feb-04 8:33 
GeneralIEnumIDList Pin
Tristan Rhodes6-Feb-04 5:27
Tristan Rhodes6-Feb-04 5:27 
I am converting COM stuff to C#, but i'm not entirely sure about IEnumIDList.Next, or what exactly it returns.

HRESULT Next( ULONG celt,
LPITEMIDLIST *rgelt,
ULONG *pceltFetched
);

Now, celt is supposed to be the size of the LPITEMIDLIST right? So this enables people to look up multiple items in one go?
The pCeltFetched is a value that indicates how many items are actualy returned of the ones you desire?

Am I right here?

I've written some code that uses this interface and appears to work fine (Note, I get the IEnumIDList via the SHGetDesktopFolder, and the methods call ok when the result is cast). But No matter how big I make Celt, i always get back 17 (I have 12 non Shortcut Items, 7 shortcut items and recycle bin on my desktop) different <rgelt> values before it begins returning null pointers (No S_False value is returned, always returns 0). Also, the pCeltFetched is always 1, until the 7th value is reached, and then it is 0.

I can't determine what is being returned in the array as I haven't casted rGelt.

This is an array of ITEMIDLIST's? Or a pointer to ITEMIDLIST that is an array?

Could someone explain this method to me, as it's mildly confusing - being new to COM and all.

Cheers

Cata

NOTE: Not sure if this is any help, but here is the sample of code that I am using to call the function. It has no purpose, i'm just experimenting, but it might show what's wrong:

<br />
			ArrayList MyIntPtrArray = new ArrayList();<br />
			int myInt = 0;<br />
			IntPtr item = new IntPtr();<br />
			int result;<br />
<br />
			do<br />
			{<br />
				result = IDList.Next(10, ref item, out myInt);<br />
				if (item.ToInt32() != IntPtr.Zero.ToInt32())<br />
				{<br />
					MyIntPtrArray.Add(item);<br />
				}<br />
				<br />
			}while(item.ToInt32() != IntPtr.Zero.ToInt32());<br />
<br />


Where result is always 0. myInt is 1 until the method retuns null pointers. Item is new for every iteration up to 17 (that's the arraylist count when the program finishes).
GeneralRe: IEnumIDList Pin
Jörgen Sigvardsson7-Feb-04 3:42
Jörgen Sigvardsson7-Feb-04 3:42 
Generalcomplier error:...undefined class 'ATL_NO_VTABLE Pin
Abhi Lahare6-Feb-04 2:02
Abhi Lahare6-Feb-04 2:02 
GeneralRe: complier error:...undefined class 'ATL_NO_VTABLE Pin
Mike Dimmick6-Feb-04 2:50
Mike Dimmick6-Feb-04 2:50 
GeneralRe: complier error:...undefined class 'ATL_NO_VTABLE Pin
Abhi Lahare6-Feb-04 3:28
Abhi Lahare6-Feb-04 3:28 
QuestionHow can i get properties of com object dynamically Pin
Inam5-Feb-04 19:47
Inam5-Feb-04 19:47 
AnswerRe: How can i get properties of com object dynamically Pin
Mike Dimmick6-Feb-04 3:23
Mike Dimmick6-Feb-04 3:23 
GeneralRe: How can i get properties of com object dynamically Pin
Inam7-Feb-04 7:20
Inam7-Feb-04 7:20 
GeneralCommercial ActiveX Control - ClistCtrl/CListView Pin
Charles Roderick4-Feb-04 5:10
Charles Roderick4-Feb-04 5:10 
GeneralRe: Commercial ActiveX Control - ClistCtrl/CListView Pin
Jörgen Sigvardsson9-Feb-04 9:59
Jörgen Sigvardsson9-Feb-04 9:59 
GeneralRe: Commercial ActiveX Control - ClistCtrl/CListView Pin
Charles Roderick9-Feb-04 12:08
Charles Roderick9-Feb-04 12:08 
GeneralSHGetPathFromIDList - Problem Pin
Tristan Rhodes4-Feb-04 3:53
Tristan Rhodes4-Feb-04 3:53 
GeneralSolved Pin
Tristan Rhodes4-Feb-04 10:55
Tristan Rhodes4-Feb-04 10:55 
GeneralRe: SHGetPathFromIDList - Problem Pin
Mike Dimmick5-Feb-04 0:58
Mike Dimmick5-Feb-04 0:58 
GeneralSHBrowseForFolder problem Pin
Tristan Rhodes4-Feb-04 1:19
Tristan Rhodes4-Feb-04 1:19 
GeneralRe: SHBrowseForFolder problem Pin
Tristan Rhodes4-Feb-04 2:01
Tristan Rhodes4-Feb-04 2:01 
GeneralPartial Solution Pin
Tristan Rhodes4-Feb-04 2:55
Tristan Rhodes4-Feb-04 2:55 
GeneralMethod overloading Pin
Anonymous3-Feb-04 4:19
Anonymous3-Feb-04 4:19 

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.