Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Need help controlling Windows Media Player Activex component

dsfiidsfii Member Posts: 1
Ok, I am using BCB 6 and have imported a windows media player activex component to my Borland program.

I created a new application and dropped the WMP activeX component on the form.

I've read all over the place and can't figure out how to access that windows media player component.

I've read up on MSDN and see all the great methods and properties such as wmp.play, stop, pause, etc etc.. But silly me can't figure out how to address the wmp comonent

Obviously simply trying to call it using the components name doesnt work, such as WindowsMediaPlayer1->play

Thanks for any help,

Comments

  • LobotomizerLobotomizer Member Posts: 5
    Hi! I just installed the WMP ActiveX component and added it to a form and by just typing:
    [italic]WindowsMediaPlayer1->[/italic]
    all the methods and properties appear and the following code worked flawlessly:
    [code]//---------------------------------------------------------------------------
    void __fastcall TForm1::Button2Click(TObject *Sender)
    {
    try
    {
    WindowsMediaPlayer1->URL = "MySong.mp3";
    WindowsMediaPlayer1->controls->play();
    }
    catch(Exception &e)
    {
    ShowMessage("Error: " + e.Message);
    }
    }
    //---------------------------------------------------------------------------
    [/code]
    If this doesn't work for you maybe the component isn't installed properly (via Component->Import ActiveX Control...)?

Sign In or Register to comment.