Click here to Skip to main content
15,908,909 members
Home / Discussions / C#
   

C#

 
QuestionRe: clipboard Pin
MoustafaS19-Oct-05 14:36
MoustafaS19-Oct-05 14:36 
AnswerRe: clipboard Pin
xilefxilef20-Oct-05 4:36
xilefxilef20-Oct-05 4:36 
Questionproblem decrypting a file Pin
Sasuko19-Oct-05 12:20
Sasuko19-Oct-05 12:20 
AnswerRe: problem decrypting a file Pin
leppie19-Oct-05 19:44
leppie19-Oct-05 19:44 
GeneralRe: problem decrypting a file Pin
Sasuko19-Oct-05 22:29
Sasuko19-Oct-05 22:29 
AnswerRe: problem decrypting a file Pin
leppie19-Oct-05 22:39
leppie19-Oct-05 22:39 
News71-528: TS: Microsoft® .NET Framework 2.0 - Web-based Client Development Pin
vipul_vips19-Oct-05 12:16
vipul_vips19-Oct-05 12:16 
QuestionCOM Collections: How to use get_Item(ref object index) Pin
dkarlton19-Oct-05 12:07
dkarlton19-Oct-05 12:07 
I just recently downloaded Windows Media Connect 2.0.

There is a DLL inside the installation (C:\Program Files\Windows Media Connect 2\wmcsci.dll) that I've imported as a reference to my C# project. I can see all the classes, and am actually able to do a number of things to interact with the Windows Media Connect server running locally. For example:

using WMCSCI;<br />
...<br />
WMCManager manager = new WMCManager();<br />
Console.WriteLine("WMC status: " + manager.Status);<br />
Devices devices = manager.GetDevices(DeviceAuthorization.AllDevices);<br />
Console.WriteLine("Devices: " + devices.Count);<br />
Libraries libraries = manager.SharedLibraries;<br />
Console.WriteLine("Shared Libraries: " + libraries.Count);<br />


All of the methods and properties seem to work -- with one exception. The COM interface defines get_Item() on a number of the interfaces, namely:

IWMCDevices<br />
IWMCLibraries<br />
IWMCProperties


(Here's a link to the get_Item() API method on IWMCDevices, for example.)

From C#, there are no "Item" or "getItem" methods, and the interfaces are not enumerable either. It requires that I use array notation to access indices in the collection.

object index = 0;<br />
IWMCDevices devices = manager.GetDevices(DeviceAuthorization.AllDevices);<br />
IWMCDevice device = devices[index];


However, the compiler requires a "ref object Index" argument when using this notation. And devices[ref index] doesn't work either.

How can I access the items in these collections? Is there some interop signature I can create to access the original get_Item() method, or is there something else that I'm missing?

Thanks!

David
AnswerRe: COM Collections: How to use get_Item(ref object index) Pin
leppie19-Oct-05 19:49
leppie19-Oct-05 19:49 
GeneralRe: COM Collections: How to use get_Item(ref object index) Pin
dkarlton20-Oct-05 3:12
dkarlton20-Oct-05 3:12 
GeneralRe: COM Collections: How to use get_Item(ref object index) Pin
dkarlton20-Oct-05 3:33
dkarlton20-Oct-05 3:33 
QuestionConfused On References Pin
budidharma19-Oct-05 12:01
budidharma19-Oct-05 12:01 
AnswerRe: Confused On References Pin
Matt Gerrans19-Oct-05 16:34
Matt Gerrans19-Oct-05 16:34 
GeneralRe: Confused On References Pin
budidharma19-Oct-05 17:32
budidharma19-Oct-05 17:32 
GeneralRe: Confused On References Pin
Matt Gerrans19-Oct-05 18:07
Matt Gerrans19-Oct-05 18:07 
GeneralRe: Confused On References Pin
S. Senthil Kumar19-Oct-05 23:04
S. Senthil Kumar19-Oct-05 23:04 
GeneralRe: Confused On References Pin
budidharma20-Oct-05 3:30
budidharma20-Oct-05 3:30 
GeneralRe: Confused On References Pin
S. Senthil Kumar20-Oct-05 4:30
S. Senthil Kumar20-Oct-05 4:30 
GeneralRe: Confused On References Pin
budidharma20-Oct-05 4:51
budidharma20-Oct-05 4:51 
GeneralRe: Confused On References Pin
S. Senthil Kumar20-Oct-05 5:41
S. Senthil Kumar20-Oct-05 5:41 
GeneralRe: Confused On References Pin
budidharma20-Oct-05 6:07
budidharma20-Oct-05 6:07 
GeneralRe: Confused On References Pin
Matt Gerrans20-Oct-05 5:34
Matt Gerrans20-Oct-05 5:34 
QuestionC# 1byte-1char strings Pin
Dave Shaw19-Oct-05 10:49
Dave Shaw19-Oct-05 10:49 
AnswerRe: C# 1byte-1char strings Pin
leppie19-Oct-05 11:04
leppie19-Oct-05 11:04 
AnswerRe: C# 1byte-1char strings Pin
Dave Kreskowiak19-Oct-05 14:04
mveDave Kreskowiak19-Oct-05 14:04 

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.