1. [Win32Lib] wrap Media control?

Has or can anyone wrap the Media control (aka Media Player) for Win32Lib?

I know Matt or Greg has wrapped it (in a dll?) for wxEuphoria, but I've got an app started using Win32Lib, & it'd be easier to continue with what I've done than "port" it over to wxEuphoria.

Maybe the wxEuphoria dll could be utilized from within Win32Lib programs?

Dan

new topic     » topic index » view message » categorize

2. Re: [Win32Lib] wrap Media control?

DanM said...

Has or can anyone wrap the Media control (aka Media Player) for Win32Lib?

I know Matt or Greg has wrapped it (in a dll?) for wxEuphoria, but I've got an app started using Win32Lib, & it'd be easier to continue with what I've done than "port" it over to wxEuphoria.

Actually, wxWidgets did all the hard work. wxEuphoria just provides a way for Euphoria to use it. Wrapping it would require EuCOM (or something similar), since it's exposed as an ActiveX object.

DanM said...

Maybe the wxEuphoria dll could be utilized from within Win32Lib programs?

I'm sure you could do it, though it wouldn't really 'integrate' with the rest of the application. Not sure if that'd matter or not. I think it would probably have to be in its own top level window.

Matt

new topic     » goto parent     » topic index » view message » categorize

3. Re: [Win32Lib] wrap Media control?

mattlewis said...
DanM said...

Has or can anyone wrap the Media control (aka Media Player) for Win32Lib?

I know Matt or Greg has wrapped it (in a dll?) for wxEuphoria, but I've got an app started using Win32Lib, & it'd be easier to continue with what I've done than "port" it over to wxEuphoria.

Actually, wxWidgets did all the hard work. wxEuphoria just provides a way for Euphoria to use it. Wrapping it would require EuCOM (or something similar), since it's exposed as an ActiveX object.

DanM said...

Maybe the wxEuphoria dll could be utilized from within Win32Lib programs?

I'm sure you could do it, though it wouldn't really 'integrate' with the rest of the application. Not sure if that'd matter or not. I think it would probably have to be in its own top level window.

Matt

Well, I do need the Media control to be a child of another window, hope the control isn't inherently limited to top level window in wxEuphoria?

Any 'hints' as to how the dll might be utilized from within Win32Lib?

It's kinda "six-of-one, or half-a-dozen-of-another" as to which I would need more help with, "porting" my Win32Lib code over to wxEuphoria, or attempting to bring Media control over from the dll to Win32Lib. I'm guessing harder to bring the control over to Win32Lib.

Dan

new topic     » goto parent     » topic index » view message » categorize

4. Re: [Win32Lib] wrap Media control?

DanM said...

Well, I do need the Media control to be a child of another window, hope the control isn't inherently limited to top level window in wxEuphoria?

No, just that I don't think that you could create a control (of any type) using wxEuphoria and make its parent a Win32Lib window.

DanM said...

Any 'hints' as to how the dll might be utilized from within Win32Lib?

It's going to need to be wrapped with EuCOM, which comes with a tool to help out with this.

DanM said...

It's kinda "six-of-one, or half-a-dozen-of-another" as to which I would need more help with, "porting" my Win32Lib code over to wxEuphoria, or attempting to bring Media control over from the dll to Win32Lib. I'm guessing harder to bring the control over to Win32Lib.

wxEuphoria is somewhat similar to Win32Lib in how it's used. Names of things are slightly different, but at least basic things like creating widgets and setting up event handlers are very similar.

Matt

new topic     » goto parent     » topic index » view message » categorize

5. Re: [Win32Lib] wrap Media control?

mattlewis said...
DanM said...

Well, I do need the Media control to be a child of another window, hope the control isn't inherently limited to top level window in wxEuphoria?

No, just that I don't think that you could create a control (of any type) using wxEuphoria and make its parent a Win32Lib window.

Matt

Not sure how wxWidgets works (or if it allows this), but if he creates the main (top-level) window with wxEuphoria and can get the HANDLE to the native top-level window, he should be able to create other controls as childs of that window using W32API directly. So it shouldn't be too hard to use Win32Lib for the rest of the app.

new topic     » goto parent     » topic index » view message » categorize

6. Re: [Win32Lib] wrap Media control?

jimcbrown said...

Not sure how wxWidgets works (or if it allows this), but if he creates the main (top-level) window with wxEuphoria and can get the HANDLE to the native top-level window, he should be able to create other controls as childs of that window using W32API directly. So it shouldn't be too hard to use Win32Lib for the rest of the app.

You can get a HWND (on windows only, of course) of a wxWidgets widget, so you could probably make a Win32Lib control the child of the wxWidgets control. Though I'm not sure if there might be any event issues (probably not).

However, I don't think that you could do the reverse. I don't think that you can inject an existing control into wxWidgets.

Matt

new topic     » goto parent     » topic index » view message » categorize

7. Re: [Win32Lib] wrap Media control?

mattlewis said...
jimcbrown said...

Not sure how wxWidgets works (or if it allows this), but if he creates the main (top-level) window with wxEuphoria and can get the HANDLE to the native top-level window, he should be able to create other controls as childs of that window using W32API directly. So it shouldn't be too hard to use Win32Lib for the rest of the app.

You can get a HWND (on windows only, of course) of a wxWidgets widget, so you could probably make a Win32Lib control the child of the wxWidgets control. Though I'm not sure if there might be any event issues (probably not).

However, I don't think that you could do the reverse. I don't think that you can inject an existing control into wxWidgets.

Matt

Which is why the top level window has to be a wxWidget window with Win32Lib child controls (and one wxWidget Media Control), instead of making the top level window with Win32Lib and adding a wxWidget to that window.

new topic     » goto parent     » topic index » view message » categorize

8. Re: [Win32Lib] wrap Media control?

jimcbrown said...
mattlewis said...
jimcbrown said...

Not sure how wxWidgets works (or if it allows this), but if he creates the main (top-level) window with wxEuphoria and can get the HANDLE to the native top-level window, he should be able to create other controls as childs of that window using W32API directly. So it shouldn't be too hard to use Win32Lib for the rest of the app.

You can get a HWND (on windows only, of course) of a wxWidgets widget, so you could probably make a Win32Lib control the child of the wxWidgets control. Though I'm not sure if there might be any event issues (probably not).

However, I don't think that you could do the reverse. I don't think that you can inject an existing control into wxWidgets.

Matt

Which is why the top level window has to be a wxWidget window with Win32Lib child controls (and one wxWidget Media Control), instead of making the top level window with Win32Lib and adding a wxWidget to that window.

Interesting!

So, before I try to re-write what I've done so far under Win32Lib into wxEuphoria lib statements, I wonder if anyone could provide a short stub pgm demoing top level wxEuphoria window with one Media Control, and a button or two from Win32Lib, with workable handlers, if that's what you're saying could be done?

What I'm as interested in, though this might NOT be workable, is as much some of the Win32Lib FUNCTIONS, as in the controls themselves, since my existing code uses things from Win32Lib like get font height, get text extents, etc.

Dan

new topic     » goto parent     » topic index » view message » categorize

9. Re: [Win32Lib] wrap Media control?

You can do everything with EuCOM. So far I've been able to wrap wmp.ocx using TBrowse, and create a control on the window and move it around (using Win32Lib). Now I'm just trying to figure out all these methods and stuff... getlost

Windows Media Player Object Model

-Greg

new topic     » goto parent     » topic index » view message » categorize

10. Re: [Win32Lib] wrap Media control?

ghaberek said...

You can do everything with EuCOM. So far I've been able to wrap wmp.ocx using TBrowse, and create a control on the window and move it around (using Win32Lib). Now I'm just trying to figure out all these methods and stuff... getlost

Windows Media Player Object Model

-Greg

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!)

Dan

new topic     » goto parent     » topic index » view message » categorize

11. Re: [Win32Lib] wrap Media control?

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

new topic     » goto parent     » topic index » view message » categorize

12. Re: [Win32Lib] wrap Media control?

ghaberek said...

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)...

Here are some likely candidates:

WindowsMediaPlayer_m_launchURL = 12, 
    -- Returns:  VT_VOID 
    -- bstrURL VT_BSTR [IN] 
 
WindowsMediaPlayer_m_openPlayer = 28 
    -- Opens the player with the specified URL 
    -- Returns:  VT_VOID 
    -- bstrURL VT_BSTR [IN] 

I'd imagine that you could use file:// to get something local to play.

Matt

new topic     » goto parent     » topic index » view message » categorize

13. Re: [Win32Lib] wrap Media control?

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 message » categorize

14. Re: [Win32Lib] wrap Media control?

DanM said...

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?

Yes. The last item in your PATH environment variable ends with a semicolon, which causes w32split() to create an empty element, which setSearchPaths() does not handle correctly. Here's the updated code to fix it:

object PATH 
 
    PATH = getenv("PATH") 
    if sequence( PATH ) then 
        PATH = w32split( PATH, ";" ) 
        PATH = w32removeItem( "", PATH ) 
        VOID = setSearchPaths( PATH ) 
    end if 

Please keep in mind, the proper fix is to remove the trailing semicolon from your PATH variable altogether...

-Greg

new topic     » goto parent     » topic index » view message » categorize

15. Re: [Win32Lib] wrap Media control?

Here's my updated example. It still doesn't load the media, but other methods work fine...

 
include Win32Lib.ew 
include wmp.ew 
without warning 
 
object PATH 
 
    PATH = getenv("PATH") 
    if sequence( PATH ) then 
        PATH = w32split( PATH, ";" ) 
        PATH = w32removeItem( "", PATH ) 
        VOID = setSearchPaths( PATH ) 
    end if 
 
constant icoMedia = extractIcon({ "wmp.dll", 7, 1 }) 
 
constant kAppName   = "Windows Media Player Demo" 
constant Main       = create( Window, kAppName, 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 Help       = create( Menu, "&Help", Main, 0, 0, 0, 0, 0 ) 
constant Help_About = create( MenuItem, "&About...", Help, 0, 0, 0, 0, 0 ) 
 
constant WMPlayer   = create_com_control( WindowsMediaPlayer_clsid_ix, getHandle(Main), 0, 0, 0, 0 ) 
constant WMControls = ref_com_object( IWMPControls3_clsid_ix, invoke(WMPlayer, {WindowsMediaPlayer_p_controls}, {}, {}, DISPATCH_PROPERTYGET) ) 
constant WMSettings = ref_com_object( IWMPSettings2_clsid_ix, invoke(WMPlayer, {WindowsMediaPlayer_p_settings}, {}, {}, DISPATCH_PROPERTYGET) ) 
 
setIcon( Main, icoMedia ) 
 
procedure Main_onOpen( integer pSelf, integer pEvent, sequence pParams ) 
 
    VOID = invoke( WMSettings, {IWMPSettings2_p_autoStart}, {w32True}, {VT_BOOL}, DISPATCH_PROPERTYPUT ) 
    VOID = invoke( WMPlayer, {WindowsMediaPlayer_p_enabled}, {w32True}, {VT_BOOL}, DISPATCH_PROPERTYPUT ) 
 
end procedure 
setHandler( Main, w32HOpen, routine_id("Main_onOpen") ) 
 
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 Main_onClose( integer pSelf, integer pEvent, sequence pParams ) 
 
    VOID = invoke( WMPlayer, {WindowsMediaPlayer_m_close}, {}, {}, DISPATCH_METHOD ) 
    release_com() 
 
end procedure 
setHandler( Main, w32HClose, routine_id("Main_onClose") ) 
 
procedure File_Open_onClick( integer pSelf, integer pEvent, sequence pParams ) 
 
    sequence filename, media 
    object pWMPCore, bstr 
    atom WMCore, WMMedia, WMError, WMErrorItem 
     
    filename = getOpenFileName( Main, "", {"All files (*.*)", "*.*"} ) 
    if length( filename ) = 0 then 
        return 
    end if 
     
    -- both methods result in #80020004 DISP_E_PARAMNOTFOUND: Parameter not found. 
     
    -- method #1 
    bstr = alloc_bstr( filename ) 
    WMMedia = ref_com_object( IWMPMedia_clsid_ix, invoke(WMPlayer, {WindowsMediaPlayer_m_newMedia}, {bstr}, {VT_BSTR}, DISPATCH_METHOD) ) 
    free_bstr( bstr ) 
     
    media = invoke( WMMedia, {IWMPMedia_p_name}, {}, {}, DISPATCH_PROPERTYGET ) 
    setText( Main, kAppName & " - " & media ) 
     
    VOID = invoke( WMPlayer, {WindowsMediaPlayer_p_currentMedia}, {WMMedia}, {VT_BYREF}, DISPATCH_PROPERTYPUT ) 
    if is_error( VOID ) then 
        VOID = message_box( sprintf("#%08x", VOID), "Error", MB_ICONERROR ) 
    end if 
     
    -- method #2 
    --bstr = alloc_bstr( filename ) 
    --VOID = invoke( WMPlayer, {WindowsMediaPlayer_p_URL}, {bstr}, {VT_BSTR}, DISPATCH_PROPERTYPUT ) 
    --free_bstr( bstr ) 
     
end procedure 
setHandler( File_Open, w32HClick, routine_id("File_Open_onClick") ) 
 
procedure Help_About_onClick( integer pSelf, integer pEvent, sequence pParams ) 
 
    sequence version 
     
    version = invoke( WMPlayer, {WindowsMediaPlayer_p_versionInfo}, {}, {}, DISPATCH_PROPERTYGET ) 
    VOID = message_box( "Version: " & version, "Windows Media Player Demo", MB_ICONINFORMATION ) 
 
end procedure 
setHandler( Help_About, w32HClick, routine_id("Help_About_onClick") ) 
 
WinMain( Main, Normal ) 

-Greg

new topic     » goto parent     » topic index » view message » categorize

16. Re: [Win32Lib] wrap Media control?

ghaberek said...

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)...

This code works for me:

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 ) 
constant Controls   = ref_com_object( IWMPControls3_clsid_ix, 
	invoke( WMPlayer, {WMPCore_p_controls}, {}, {}, DISPATCH_PROPERTYGET ) ) 
constant Playlist   = ref_com_object( IWMPPlaylist_clsid_ix,  
	invoke(WMPlayer, {WMPCore_p_currentPlaylist}, {}, {}, DISPATCH_PROPERTYGET ) ) 
 
setIcon( Main, icoMedia )  
com_err_out( 1 ) 
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") )  
  
function new_media( sequence url ) 
	atom bstr 
	integer media 
	object void 
	bstr = alloc_bstr( url ) 
	media = ref_com_object( IWMPMedia_clsid_ix ,  
		invoke( WMPlayer, { WMPCore_m_newMedia }, {bstr}, {VT_BSTR}, DISPATCH_METHOD ) ) 
	free_bstr( bstr ) 
	 
	void = invoke(Playlist, {IWMPPlaylist_m_appendItem}, {get_obj_this(media)}, {VT_UNKNOWN}, DISPATCH_METHOD ) 
	return media 
end function 
 
procedure play_media( integer media ) 
	object void 
	void = invoke( Controls, {IWMPControls3_m_playItem},  
		{get_obj_this(media)}, {VT_UNKNOWN}, DISPATCH_METHOD ) 
	 
end procedure 
 
procedure File_Open_onClick( integer pSelf, integer pEvent, sequence pParams )  
  
    sequence filename  
    atom bstr  
    integer media 
    filename = getOpenFileName( Main, "", {"All files (*.*)", "*.*"} )  
    if length( filename ) = 0 then  
        return  
    end if 
    media = new_media( "file:///" & filename ) 
    play_media( media ) 
end procedure  
setHandler( File_Open, w32HClick, routine_id("File_Open_onClick") )  
  
WinMain( Main, Normal )  
release_com() 

Matt

new topic     » goto parent     » topic index » view message » categorize

17. Re: [Win32Lib] wrap Media control?

Awesome, Matt! That works great! grin I wonder why my methods didn't work, though. All the examples I found used either the URL property or the newMedia/currentMedia method I was using. getlost

On a side note, do I have to call release_com() after WinMain() or can I call it from the w32HClose event like I have been?

-Greg

new topic     » goto parent     » topic index » view message » categorize

18. Re: [Win32Lib] wrap Media control?

ghaberek said...

Awesome, Matt! That works great! grin I wonder why my methods didn't work, though. All the examples I found used either the URL property or the newMedia/currentMedia method I was using. getlost

Well, I used the newMedia method. Looking at the Control::play method, I saw that it required the item to be on the current playlist, which was the final piece of the puzzle.

ghaberek said...

On a side note, do I have to call release_com() after WinMain() or can I call it from the w32HClose event like I have been?

As long as you don't do any more COM stuff after you release it, you're fine.

Matt

new topic     » goto parent     » topic index » view message » categorize

19. Re: [Win32Lib] wrap Media control?

Greg, Matt, thank you both for working to wrap this!
Rapid Euphoria, indeed! Outstanding!
Thank you, thank you, thank you!grin

And Greg, yes, my Path had a semi-colon at it's end, removing it as you suggested fixed my previous problem, thanks!

Of course, I have a few more questions. smile

Works fine, but in playing, dos display asserts this: IUnknown::QueryInterface(80004002) Could not find implemented interface: 6D5140C1-7436-11CE-8034-00AA006009FA

While it runs just fine under Administrator, it only momentarily flikers in and out of existance on non-Admin account; any ideas why?

How can I programmatically query/alter the point in time a file is playing at?

Where would I look to try to answer questions like the one above myself, or do I just not know enough to try?

Dan

new topic     » goto parent     » topic index » view message » categorize

20. Re: [Win32Lib] wrap Media control?

DanM said...

Greg, Matt, thank you both for working to wrap this!
Rapid Euphoria, indeed! Outstanding!
Thank you, thank you, thank you!grin

And Greg, yes, my Path had a semi-colon at it's end, removing it as you suggested fixed my previous problem, thanks!

Of course, I have a few more questions. smile

Works fine, but in playing, dos display asserts this: IUnknown::QueryInterface(80004002) Could not find implemented interface: 6D5140C1-7436-11CE-8034-00AA006009FA

I added:

com_err_out( 1 )  

...which shows diagnostic information printed to the console. Not all COM objects implement all interfaces. EuCOM checks for certain interfaces in the object (and there are more for an ActiveX control, like this one is). You can remove that, or put it somewhere else, though it's useful to have for development.

DanM said...

While it runs just fine under Administrator, it only momentarily flikers in and out of existance on non-Admin account; any ideas why?

That's odd. You might try removing the icon extraction. I would think that the other stuff should be allowed.

DanM said...

How can I programmatically query/alter the point in time a file is playing at?

Where would I look to try to answer questions like the one above myself, or do I just not know enough to try?

The first place to look would be in wmp.ew. Try looking at some of the constants for the Controls. I think I saw some methods that deal with what you're looking for. If you haven't already, you should familiarize yourself with EuCOM, at least so that you can understand the code that Greg and I wrote.

Matt

new topic     » goto parent     » topic index » view message » categorize

21. Re: [Win32Lib] wrap Media control?

mattlewis said...
DanM said...

While it runs just fine under Administrator, it only momentarily flikers in and out of existance on non-Admin account; any ideas why?

That's odd. You might try removing the icon extraction. I would think that the other stuff should be allowed.

Matt

I sprinkled:

puts(1, "press a key\n")
VOID = wait_key()

throughout, to try and see how far it might get before winking out,
and eventually put it right after include win32Lib, and it didn't get that far,
which is before the icon extract.

I also tried putting release_com() into an onClose window, like Greg has, and it still just flickers in and then out of existance.

Other .exw will run.

Puzzling, no?

Dan

new topic     » goto parent     » topic index » view message » categorize

22. Re: [Win32Lib] wrap Media control?

mattlewis said...
DanM said...

How can I programmatically query/alter the point in time a file is playing at?

Where would I look to try to answer questions like the one above myself, or do I just not know enough to try?

The first place to look would be in wmp.ew. Try looking at some of the constants for the Controls. I think I saw some methods that deal with what you're looking for. If you haven't already, you should familiarize yourself with EuCOM, at least so that you can understand the code that Greg and I wrote.

Matt

I actually did think of looking into wmp.ew, and had found
IWMPControls3_p_currentPositionTimecode,
but that just REPORTS the current position, there's nothing I saw that would allow SETTING it, I think.
There are a lot of interesting things like fast forward & backward, tho. I'll keep looking.

I also had given EuCom a look, so I have the barest minimal understanding of what you all did, or maybe somewhat less than minimal.

Thanks again Matt, Greg! What a nice piece of work! smile

Dan

new topic     » goto parent     » topic index » view message » categorize

23. Re: [Win32Lib] wrap Media control?

DanM said...

I actually did think of looking into wmp.ew, and had found
IWMPControls3_p_currentPositionTimecode,
but that just REPORTS the current position, there's nothing I saw that would allow SETTING it, I think.
There are a lot of interesting things like fast forward & backward, tho. I'll keep looking.

Actually, that's a read/write property: Controls.currentPositionTimecode. So you should be able to set it as well.

Also, you might try putting a trace(3) in win32lib, to see where it gets (you'll probably also need to put with trace in there).

Matt

new topic     » goto parent     » topic index » view message » categorize

24. Re: [Win32Lib] wrap Media control?

mattlewis said...
DanM said...

I actually did think of looking into wmp.ew, and had found
IWMPControls3_p_currentPositionTimecode,
but that just REPORTS the current position, there's nothing I saw that would allow SETTING it, I think.
There are a lot of interesting things like fast forward & backward, tho. I'll keep looking.

Actually, that's a read/write property: Controls.currentPositionTimecode. So you should be able to set it as well.

Thanks, good to know!

mattlewis said...

Also, you might try putting a trace(3) in win32lib, to see where it gets (you'll probably also need to put with trace in there).

Matt

Even though it "fails" just after/during(?) Win32Lib include, it's hard to imagine how the problem could be inside Win32Lib, when other pgms based on it run ok. It seems (to me) more likely that it never even does the include at all, for some reason. I'll make it try to wait before the include, I was just to lazy to type a few lines of code instead of using VOID from Win32Lib, jeeze!

Dan

new topic     » goto parent     » topic index » view message » categorize

25. Re: [Win32Lib] wrap Media control?

DanM said...

Even though it "fails" just after/during(?) Win32Lib include, it's hard to imagine how the problem could be inside Win32Lib, when other pgms based on it run ok. It seems (to me) more likely that it never even does the include at all, for some reason. I'll make it try to wait before the include, I was just to lazy to type a few lines of code instead of using VOID from Win32Lib, jeeze!

Dan

It was my path & include Enviromentals sad
I must have had them set differently on non-admin account.
Dumb.

Dan

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu