Well this forum hasn't really got a suitable area for this post, so general is the best place in the circumstances so here goes...
I am developing a home music system on my pc, and have run across some problems with the Windows Media Player 9 SDK. I need to access the Media Library this should be able to be done using a Primary Interop Assembly (PIA), which is supplied, some of the method calls haven't been included in the PIA.
Reading an article on MSDN http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/vb_player_article.asp
Well this is quite true, running the code included in the article works
Now, here's the problem the same in C# doesn't, C# knows that the declaration is not included within the Interop code and will not build if you ignore errors it will run but returns the wrong result.
Why can Visual Basic .NET run this code and C# can't, is there something you can do within the settings of the compiler to make C# run the code successfully or an attribute you can apply to the code.
I am developing a home music system on my pc, and have run across some problems with the Windows Media Player 9 SDK. I need to access the Media Library this should be able to be done using a Primary Interop Assembly (PIA), which is supplied, some of the method calls haven't been included in the PIA.
Reading an article on MSDN http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/vb_player_article.asp
IntelliSense did not list getItemInfoByType as an option. This happens because some of the newer features of the Player control are exposed through interfaces that are not published in the COM type library..... Nevertheless, you can use these features in Visual Basic just fine.
Well this is quite true, running the code included in the article works
Code:
lblTitle.Text = "Title: " & Player.currentMedia.getItemInfoByType("Title", "", 0)
Now, here's the problem the same in C# doesn't, C# knows that the declaration is not included within the Interop code and will not build if you ignore errors it will run but returns the wrong result.
Why can Visual Basic .NET run this code and C# can't, is there something you can do within the settings of the compiler to make C# run the code successfully or an attribute you can apply to the code.