VB equivilant to c++

Soldato
Joined
18 Oct 2002
Posts
3,074
Location
MK
Looking at some c++ code and trying to convert it into VB code.

this is from the microsoft documentation, there is no equvilant to VB anywhere. My main sruggle is converting the VAR into a VB equivilant.

Code:
 // Retrieve a PlaylistArray object that contains 
// exactly one Playlist object.
var plarray = WMP9.playlistCollection.[color=#ffffff]getByName[/color]("MyPlaylist");

// Get the Playlist object from the PlaylistArray object.
// The Playlist object has index number zero.
var pl = plarray.item(0);

// Make the retrieved playlist the current playlist.
WMP9.currentPlaylist = pl;

It could be a really easy solution, but my head is overloaded tonight :(
 
Er what c++ has no var data type? Looks like JScript to me. As for what to use it depends on what type .getByName("MyPlaylist") is returning. I guess an object?
 
Last edited:
Una said:
Er what c++ has no var data type?

Thought so! I dont understand this code :(

Damm MS!!

Still reading the documentation, but no refrence to the VAR thing.

Its the SDK for windows media player 10
 
In Jscript var is just anything since its non strong statically typed language. Your looking at object or similar in VB (Depends what the method returns).
 
Last edited:
isn't a weekly types object just a dim in VB?

and I don't think you can blame microsoft for the inability of C++ to have an untyped variable. You could try treating it as a generic object and then using reflection in the code to figure out what type it is?

HT
 
Back
Top Bottom