Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Hello,

Does anyone know where I can find a simple example of how to implement a media viewer in Brew? That is, I wish to register a mime type and extension so that when the user attempts to look at the file in a file manager or web browser, my applet is started to view the file.

I know it's possible because I've found lots of forum threads discussing it, but unfortunately all the documentation and example links in the threads are invalid due to the website relaunch. And I can't find much in the documentation myself. An example I can look at and play with would be really helpful...

 

Hi David,
Have you looked at our sample apps listed here: https://developer.brewmp.com/resources/attach/samplecode  We have several apps like c_mediaplayer and Creating and Setting Up an IMedia Object that might very well be able to demonstrate what you're trying to achieve.  Let me know if you have specific requirements that these samples don't exhibit and I'll take a look and see what else I can dig up for you.  There are also some threads under our Media Forum that might be of interest to you.  Hope this helps.
Regards,
Brian

Hi David,
Have you looked at our sample apps listed here: https://developer.brewmp.com/resources/attach/samplecode  We have several apps like c_mediaplayer and Creating and Setting Up an IMedia Object that might very well be able to demonstrate what you're trying to achieve.  Let me know if you have specific requirements that these samples don't exhibit and I'll take a look and see what else I can dig up for you.  There are also some threads under our Media Forum that might be of interest to you.  Hope this helps.
Regards,
Brian

No, I don't want to use the media framework; I want to register a mime type and extension so that when the user attempts to look at the file in a file manager or web browser, my applet is started to view the file.
The only relevant thing I've found in the documentation so far is ISHELL_RegisterHandler(), but there's no indication of how to use it, which is why I'm looking for example code.

No, I don't want to use the media framework; I want to register a mime type and extension so that when the user attempts to look at the file in a file manager or web browser, my applet is started to view the file.
The only relevant thing I've found in the documentation so far is ISHELL_RegisterHandler(), but there's no indication of how to use it, which is why I'm looking for example code.

Hi David,
I understand your query now.  Hopefully this will answer your question.  We generally add the mime dependency to the MIF itself.  The usage of ISHELL_RegisterHandler would be depend upon the file types you want to open:
Suppose for jpg image this is it:ISHELL_RegisterHandler(pIShell, AEECLSID_VIEW, “image/jpg”, CLASSIDOFYOURHANDLER);
Also the browser and FileMananger should implement to call ISHELL_BrowseURL() with the mime type or use ISHELL_GetHandler to get the classid of your Handler & pass the query to your handler, when someone tries to open a JPG image or the type of file you register for.
Regards,
Brian

Hi David,
I understand your query now.  Hopefully this will answer your question.  We generally add the mime dependency to the MIF itself.  The usage of ISHELL_RegisterHandler would be depend upon the file types you want to open:
Suppose for jpg image this is it:ISHELL_RegisterHandler(pIShell, AEECLSID_VIEW, “image/jpg”, CLASSIDOFYOURHANDLER);
Also the browser and FileMananger should implement to call ISHELL_BrowseURL() with the mime type or use ISHELL_GetHandler to get the classid of your Handler & pass the query to your handler, when someone tries to open a JPG image or the type of file you register for.
Regards,
Brian

Unfortunately not --- I simply don't know enough.
For example: if I add the MIME dependency to my CIF file do I still need to use ISHELL_RegisterHandler()? If so, what happens if someone calls ISHELL_BrowseURL() before my applet has run, and so before it's called ISHELL_RegisterHandler()? How can I use my applet as a handler, given that handlers appear to have to be an IQueryInterface and IApplet doesn't inherit from this? Do I need to implement a stub handler which launches my applet and notifies it that someone's trying to view the file? If so, how? How does information about what file's getting viewed get passed to the handler anyway? How do I register in the CIF file that my application is interested in a particular MIME type anyway?
I can't find any of this in the documentation, and most of this stuff is architectural issues that API documentation doesn't help much with anyway. This is why I'm looking for a complete example I can look at and pick apart. The ability to associate an application with a file type must be a common use case...

Unfortunately not --- I simply don't know enough.
For example: if I add the MIME dependency to my CIF file do I still need to use ISHELL_RegisterHandler()? If so, what happens if someone calls ISHELL_BrowseURL() before my applet has run, and so before it's called ISHELL_RegisterHandler()? How can I use my applet as a handler, given that handlers appear to have to be an IQueryInterface and IApplet doesn't inherit from this? Do I need to implement a stub handler which launches my applet and notifies it that someone's trying to view the file? If so, how? How does information about what file's getting viewed get passed to the handler anyway? How do I register in the CIF file that my application is interested in a particular MIME type anyway?
I can't find any of this in the documentation, and most of this stuff is architectural issues that API documentation doesn't help much with anyway. This is why I'm looking for a complete example I can look at and pick apart. The ability to associate an application with a file type must be a common use case...

if I add the MIME dependency to my CIF file do I still need to use ISHELL_RegisterHandler()? 
- No, if you add the MIME in MIF, you do not need to register again using ISHELL_RegisterHandler() and or vice verca.

if I add the MIME dependency to my CIF file do I still need to use ISHELL_RegisterHandler()? 
- No, if you add the MIME in MIF, you do not need to register again using ISHELL_RegisterHandler() and or vice verca.