Re: [Win32Lib] wrap Media control?

new topic     » goto parent     » topic index » view thread      » older message » newer message
ghaberek said...
DanM said...

I haven't looked at EuCOM yet, Matt also mentioned it, my head is still spinning trying to wrap my brain around wxEuphoria. getlost

So I'd be real happy if you were able to figure out how to make Media control usable via Win32Lib grin

Are you saying you're heading in that direction (hope, hope, hope!)

Here's the wrapped EuCOM file, for those interested (requires EuCOM and Win32Lib): wmp.ew (267 KB)

This is what I have so far (note the "now what" part)...

include Win32Lib.ew 
include wmp.ew 
without warning 
 
object PATH 
 
    PATH = getenv("PATH") 
    if sequence( PATH ) then 
        PATH = w32split( PATH, ";" ) 
        VOID = setSearchPaths( PATH ) 
    end if 
 
constant icoMedia   = extractIcon({ "wmp.dll", 7, 1 }) 
constant Main       = create( Window, "Windows Media Player Demo", 0, Default, Default, 640, 480, 0 ) 
constant File       = create( Menu, "&File", Main, 0, 0, 0, 0, 0 ) 
constant File_Open  = create( MenuItem, "&Open...", File, 0, 0, 0, 0, 0 ) 
constant File_Sep1  = create( MenuItem, "-", File, 0, 0, 0, 0, 0 ) 
constant File_Exit  = create( MenuItem, "E&xit", File, 0, 0, 0, 0, w32AUTOCLOSE ) 
constant WMPlayer   = create_com_control( WindowsMediaPlayer_clsid_ix, getHandle(Main), 0, 0, 0, 0 ) 
 
setIcon( Main, icoMedia ) 
 
procedure Main_onResize( integer pSelf, integer pEvent, sequence pParams ) 
 
    sequence rect 
     
    rect = getClientRect( pSelf ) 
    move_obj( WMPlayer, rect[1..4] ) 
     
end procedure 
setHandler( Main, w32HResize, routine_id("Main_onResize") ) 
 
procedure File_Open_onClick( integer pSelf, integer pEvent, sequence pParams ) 
 
    sequence filename 
    atom bstr 
     
    filename = getOpenFileName( Main, "", {"All files (*.*)", "*.*"} ) 
    if length( filename ) = 0 then 
        return 
    end if 
     
    -- ...now what? 
     
end procedure 
setHandler( File_Open, w32HClick, routine_id("File_Open_onClick") ) 
 
WinMain( Main, Normal ) 

-Greg

Wow, I never expected this much so soon! I really hate to have to leave for the rest of the day! sad

I did set up to see what your code + EuCom + your wrap did, and got this error on my system:

C:\Programming\EUPHORIA\Libraries\Win32Lib_60_5\Include\w32file.ew:1114
in function setSearchPaths()
subscript value 0 is out of bounds, reading from a sequence of length 0

Any obvious cause leap out at anyone?

Dan (regretfully signing off for rest of day)

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu