Note that there are some explanatory texts on larger screens.

plurals
  1. POProperty page for custom Directshow filter
    text
    copied!<p>I managed to create a custom DirectShow transform filter, register it, and export it in a DLL. It now works properly in both GraphEdit and a C++ test program. My next goal is to create a custom interface to control the filter's main parameter, from a test app or from a property page in GraphEdit.</p> <p>Following <a href="http://msdn.microsoft.com/en-us/library/dd375010%28v=VS.85%29.aspx" rel="nofollow">these instructions</a>, I got my custom interface working properly from the C++ test program. However, I'm facing difficulties with the property page : I keep getting the error message "The requested property page could not be displayed" in GraphEdit.</p> <p>While debugging, I found that the only methods called (in my custom property page class, derived from CBasePropertyPage) are <code>OnConnect()</code> and <code>OnDisconnect()</code> - which is oddly (or not ?) called twice. Between these two methods, some calls are made to CBasePropertyPage methods (file cprop.cpp in baseclasses), and everything looks fine until :</p> <p><code>STDMETHODIMP CBasePropertyPage::Activate(HWND hwndParent, LPCRECT pRect, BOOL fModal)</code></p> <p>and more precisely</p> <p><code>m_hwnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(m_DialogId), hwndParent, DialogProc, (LPARAM) this);</code></p> <p>I always get <code>m_hwnd</code> at 0, causing the method to return with an error. I tried to add <code>GetLastError()</code> right after this instruction, but it always returns 0, no error. Moreover, every parameter of <code>CreateDialogParam()</code> looks properly initialized...</p> <p>Any help would be greatly appreciated !</p> <p><br/> <strong>EDIT</strong> :</p> <p>For now, in order to at least have a working example, I've used the <em>same</em> resources/templates described in the <a href="http://msdn.microsoft.com/en-us/library/dd375010%28v=VS.85%29.aspx" rel="nofollow">MSDN tutorial</a>.</p> <p><br/> <strong>---EDIT 2---</strong> :</p> <p>While debugging a little bit more, I tried deleting every single control (button, scroller) from the Dialog resource. After that... everything works. <code>CreateDialogParam()</code> returns a correct value, my class's <code>OnActivate()</code> is called and so on. I eventually get a "filter properties" page in GraphEdit, but empty (except from the default dialog window).</p> <p>But as soon as I had a control, e.g. a MF command button, the previous problems appear.</p> <p>Is there any kind of incompatibility between DirectShow base classes and the controls I use ? (And if so, why isn't the provided sample mentioning anything ?) Is there any simpler way to add controls to the property page ?</p> <p>(I'm definitely <em>not</em> an expert with GUIs and Win32 controls...)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload