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

C#

 
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 
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 
That may be well and good to be able to use the UPnP interface to WMC. And I may be able to get the same functionality. But ultimately I want to use the WMC API, in part because it seems ridiculous that it's not possible to use .NET and C# to cleanly access the COM API's. If the workaround to this issue is "use a different tool" then my gut reaction is "why am I using broken tools in the first place?" Clearly, I am just stubborn. OK, enough of my ranting.

In the meantime, I've made a kludged reflection workaround to handle get_Item(). I'm still hoping there's someone out there who can offer a more elegant solution:

int index = 0;<br />
WMCManager manager = new WMCManager();<br />
Devices devices = manager.GetDevices(DeviceAuthorization.AllDevices);<br />
Device d = (Device)devices.GetType().InvokeMember("Item", BindingFlags.GetProperty, null, devices, new object[]{index});


And by the way, if I wanted to use UPnP instead of the WMC API, there's still an issue of using interop to handle events and asynchronous discovery:

[ComImport, Guid("415A984A-88B3-49F3-92AF-0508BEDF0D6C"),<br />
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]<br />
internal interface IUPnPDeviceFinderCallback<br />
{<br />
	void DeviceAdded(int lFindData, IUPnPDevice pDevice);<br />
	void DeviceRemoved(int lFindData, string bstrUDN);<br />
	void SearchComplete(int lFindData);<br />
}<br />
<br />
[ComImport, Guid("31fadca9-ab73-464b-b67d-5c1d0f83c8b8"),<br />
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]<br />
public interface IUPnPServiceCallback<br />
{<br />
	void StateVariableChanged(IUPnPService pus,<br />
	[MarshalAs(UnmanagedType.LPWStr)] string pcwszStateVarName, object vaValue);<br />
	void ServiceInstanceDied(IUPnPService pus);<br />
}<br />


Cheers,

David
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 
GeneralRe: C# 1byte-1char strings Pin
lmoelleb19-Oct-05 20:58
lmoelleb19-Oct-05 20:58 
AnswerRe: C# 1byte-1char strings Pin
uno freeware19-Oct-05 16:45
uno freeware19-Oct-05 16:45 

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.