Sign in to follow this  
Followers 0
BrettF

WMplayer Object not working...

5 posts in this topic

My Code:

$oPlayer = GUICtrlCreateObj("WMPlayer.OCX", 8, 0, 537, 281)
    If Not IsObj($oPlayer) Then
        MsgBox(0, "Error", "$oPlayer is not an Object.")
    Else
        MsgBox(0, "Error", "Successfully created Object $oPlayer.")
    EndIf
    $Button1 = GUICtrlCreateButton("", 360, 328, 41, 41, 0,$BS_BITMAP)
    GUICtrlSetImage ($Button1, @ScriptDir & "\play.bmp" )

My Problems:

First of all, I can't get the image to show on the button And $oPlayer is always returning- "$oPlayer is not an Object.". It will never show. :D, and where is the MSDN libary of wmplayer controls?? I cant find them anywhere... :D:P ...and ive looked hard.

Thanks :)

Share this post


Link to post
Share on other sites



You must first create the object before creating the GUI Object.

#include <GUIConstants.au3>

$oPlayer = ObjCreate("WMPlayer.OCX")
If Not IsObj($oPlayer) Then
    MsgBox(0, "Error", "$oPlayer is not an Object.")
Else
    MsgBox(0, "Error", "Successfully created Object $oPlayer.")
EndIf

GUICreate("Test")
$hPlayer = GUICtrlCreateObj($oPlayer, 8, 0, 537, 281)
$Button1 = GUICtrlCreateButton("", 360, 328, 41, 41, 0, $BS_BITMAP)
GUICtrlSetImage($Button1, @ScriptDir & "\play.bmp")
GUISetState()

While 1
    Sleep(100)
WEnd

Share this post


Link to post
Share on other sites

You must first create the object before creating the GUI Object.

#include <GUIConstants.au3>

$oPlayer = ObjCreate("WMPlayer.OCX")
If Not IsObj($oPlayer) Then
    MsgBox(0, "Error", "$oPlayer is not an Object.")
Else
    MsgBox(0, "Error", "Successfully created Object $oPlayer.")
EndIf

GUICreate("Test")
$hPlayer = GUICtrlCreateObj($oPlayer, 8, 0, 537, 281)
$Button1 = GUICtrlCreateButton("", 360, 328, 41, 41, 0, $BS_BITMAP)
GUICtrlSetImage($Button1, @ScriptDir & "\play.bmp")
GUISetState()

While 1
    Sleep(100)
WEnd
It returns "$oPlayer is not an Object."... What should i have installed but probably wouldnt?

Share this post


Link to post
Share on other sites

Your welcome. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0