how to implement source filter property page? - directshow

I have followed the instructions at http://msdn.microsoft.com/en-us/library/windows/desktop/dd375010%28v=vs.85%29.aspx to create a property page for my CSourceStream based stream.
When testing with amcap I can see that amcap now shows the menu item to show the capture pin properties (ISpecifyPropertyPages::GetPages is queried). The problem is that when amcap calls OleCreatePropertyFrame it returns with E_FAIL and I am not sure why, it does not seem to even get to the stage of quering my dll for the factory method to instantiate the CBasePropertyPage based property class.

The problem was my DllRegisterServer only registered my filter.
I can use AMovieDllRegisterServer2 to register all components in g_Templates but that function does not register source filters properly so for the moment I am just calling AMovieDllRegisterServer2 and then re-registering my filter with source filter specific code.

Related

Subclass INObject?

Can one subclass INObject?
I ask because I have an Intents Handler Extension for Siri Shortcuts. I attempted to create a subclass for INObject because I want to add an extra property. Seems like it works just fine here.
However, I also have an Intents Handler UI Extension. When my response object gets to this point, I have a handle on the INObject and its identifier and display string. But, when I try to cast it to my custom INObject sublcassed type, the result is nil and therefore I cannot access my custom property.
Does anyone know how to pass custom properties from the Intents Extension to the Intents UI Extension using the custom INObject?
Apple Engineering got back to me that this is not supported.

Getting the current FreshMVVM PageModel's CoreMethods

I have a service called AuthHelper, from which I take care of all of my application's navigation based on authentication status. In order to call the push or pop navigation methods on the navigation stacks I am using, I need to have access to a PageModel's CoreMethods object.
I have made this work by just passing the CoreMethods object in to every AuthHelper method which requires it. It would be more convenient, however, to just get the current FreshMVVM PageModel in the AuthHelper and derive the CoreMethods object from that.
I thought I had found what I was looking for in the Application.Current.MainPage.GetModel() FreshMVVM extension method. However it looks like that is not working because Application.Current.MainPage is referring to the navigation container I am using (the type of container changes depending on the application's current authentication status) instead of the current page, which is required by the GetModel() method.
Is there any way to get the current PageModel, more specifically the CoreMethods object, from a helper service without passing it as a parameter?
In the past I have passed in the CoreMethods instance when I am in that situation, however have you tried Application.Current.MainPage.CurrentPage where the CoreMethods are on that CurrentPage?

Why does the error occurs then I try to utilize pzRDExportWrapper in Pega 7.1.8?

I have a task to export a repeat grid's content to Excel. I have read an
article, but I still can't realize how to properly use it. I tried to repeat article's steps to provide pzRDExportWrapper, but after I click "Save" button I get the error:
Method: Rule-Obj-Activity instance not found:
Sb-FW-CTrackFW-Work.pzRDExportWrapper. Details: Invalid value for
Activity name passed to ActivityAssembler.
Could anybody give me any suggestions? Thank you.
You invoke activity from another activity which applies to class Sb-FW-CTrackFW-Work. Rule Resolution use primary context Sb-FW-CTrackFW-Work class and try invoke activity pzRDExportWrapper from it and you get error (because rule resolution can't found invoked activity in this class).
Activity pzRDExportWrapper applies to Rule-Obj-Report-Definition class. Try invoke from it.
Try activity step as below:
Call Rule-Obj-Report-Definition.pzRDExportWrapper
Or use step page for this step which defined as applies to Rule-Obj-Report-Definition class(you can declare it on Pages&Classes tab)
Okay. I have resolved the issue (thank you njc). I have two sections on a lone web page.
A context of the first section is my custom data page Co-Name-FW-Data-Search. The Search page has some single value properties which are initialized by an user via an UI.
The second section is a repeat grid section, a report definition as a source. My Search page pointed out in a Pages and Classes tab. Also there is a Page, which is created by report definition and contains results. The report definition takes Search’s values as parameters.
So, I have created an activity and passed the Search page and a Cods-Pega-List MyResultList as parameters. There are some steps in the activity:
Check if Search is null. If true- skip step; else - transfer Search properties into Params props with Data Transform.
Set Param.exportmode = "excel"
Call pzRDExportWrapper with Step Page MyResultList.pyReportDefinition. Pass current parameter page.
P.S.: If it doesn’t work try to play with report definition’s settings.
P.P.S.: An only minus of pzExportWrapper is that it invokes report definition again.

Type Coercion error when casting an object loaded in a different application domain

My application currently contains a number of Widgets that are managed by a Widget Manager. When the user clicks on a widget (e.g. a Helper widget), the Widget Manager loads the widget into a separate sibling application domain with the following line of code:
wgtInfo.load(null, null, null, moduleFactory); //wgtInfo = IModuleInfo
However, I am unable to use the widget's variables and functions later on. I attempt to find the Helper widget from the Widget Manager's list of widgets, and I do successfully. But when I try to caste the Helper Widget from type IBaseWidget (the interface all widgets share) to type HelperWidget, I receive the following error:
TypeError: Error #1034: Type Coercion failed.....
This is because the application domain of the class trying to use the Helper widget is different from the application domain of the Helper Widget. I tried to fix this by loading all widgets into the same application domain as the loader:
wgtInfo.load(ApplicationDomain.currentDomain, null, null, moduleFactory);
I now get the following error whenever I attempt to load the Helper widget:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
How can I load my Helper widget into a common application domain that is accessible by the other widgets?
I believe your problem comes from the class not being included in the swf. This is because Flash doesn't compile in classes in a swf if they aren't used to reduce filesize. To prevent this, you only need to create a variable with the helper class you need in that class, like this:
private var helper:HelperWidget;
See if that helps.
I'm gonna repost my 'comment' as a real answer. I'm guessing that the error is not based on the ApplicationDomain but based on which classes you are being compiled into your Module. When Flex compiles the SWF it automatically optimizes unused classes out of the SWF. You can force them back into the SWF in one of two ways:
Use the compiler argument include-libraries to force the Flex compiler to add the class to your SWF.
Add a fake variable in in your application so that the Flex compiler thinks it is used and adds it to the final SWF. Something like this.
private var myFakeObject : HelperWidth;
After trying a number of solutions unsuccessfully (including the other responses on this page), I resorted to another, event-driven, solution.
I ended up dispatching a custom event to notify my other widgets when the Helper widget had completed loading:
(HelperWidget.mxml)
ViewerContainer.addEventListener(AppEvent.WIDGET_OPEN_TAB, widgetOpenTabHandler); //listen for other widgets to open a tab within the Helper Widget
ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_READY_OPEN_TAB)); //notify other widgets that loading is complete
My other widgets listen for this event to fire, and upon completion, dispatch another event (AppEvent.WIDGET_OPEN_TAB) to perform a function within the Helper widget.

React to change on a static property

I'm re-writing an MXML item renderer in pure AS. A problem I can't seem to get past is how to have each item renderer react to a change on a static property on the item renderer class. In the MXML version, I have the following binding set up on the item renderer:
instanceProperty={callInstanceFunction(ItemRenderer.staticProperty)}
What would be the equivalent way of setting this up in AS (using BindingUtils, I assume)?
UPDATE:
So I thought the following wasn't working, but it appears as if Flex is suppressing errors thrown in the instanceFunction, making it appear as if the binding itself is bad.
BindingUtils.bindSetter(instanceFunction, ItemRenderer, "staticProperty");
However, when instanceFunction is called, already initialized variables on the given instance are all null, which was the cause of the errors referenced above. Any ideas why this is?
You have 2 options that I am aware of:
Option 1
You can dig into the code that the flex compiler builds based on your MXML to see how it handles binding to static properties. There is a compiler directive called -keep-generated-actionscript that will cause generated files to stick around. Sleuthing through these can give you an idea what happens. This option will involve instantiating Binding objects and StaticPropertyWatcher objects.
Option 2
There is staticEventDispatcher object that gets added at build time to classes containing static variables see this post http://thecomcor.blogspot.com/2008/07/adobe-flex-undocumented-buildin.html. According to the post, this object only gets added based on the presence of static variables and not getter functions.
Example of Option 2
Say we have a class named MyClassContainingStaticVariable with a static variable named MyStaticVariable and another variable someobject.somearrayproperty that we want to get updated whenever MyStaticVariable changes.
Class(MyClassContainingStaticVariable).staticEventDispatcher.addEventListener(
PropertyChangeEvent.PROPERTY_CHANGE,
function(event:PropertyChangeEvent):void
{
if(event.property == "MyStaticVariable")
{
someobject.somearrayproperty = event.newValue as Array;
}
});
I think you need to respond to the "PropertyChanged" event.
If you're going to do that, use a singleton instead of static. I don't think it will work on a static. (If you have to do it that way at all, there are probably a couple ways you could reapproach this that would be better).
var instance:ItemRenderer = ItemRenderer.getInstance();
BindingUtils.bindProperty(this, "myProperty", instance, "theirProperty");
After fiddling with this for a while, I have concluded that this currently isn't possible in ActionScript, not even with bindSetter. It seems there are some MXML-only features of data bindings judging by the following excerpt from the Adobe docs (though isn't it all compiled to AS code anyways)?
You cannot include functions or array
elements in property chains in a data
binding expression defined by the
bindProperty() or bindSetter() method.
For more information on property
chains, see Working with bindable
property chains.
Source: http://livedocs.adobe.com/flex/3/html/help.html?content=databinding_7.html
You can create a HostProxy class to stand in for the funciton call. Sort of like a HostFunctionProxy class which extends from proxy, and has a getProperty("functionInvokeStringWithParameters") which will invoke the function remotely from the host, and dispatch a "change" event to trigger the binding in typical [Bindable("change")] Proxy class.
You than let the HostProxy class act as the host, and use the property to remotely trigger the function call. Of course, it'd be cooler to have some TypeHelperUtil to allow converting raw string values to serialized type values at runtime for method parameters (splitted by commas usually).
Example:
eg.
var standInHost:Object = new HostFunctionProxy(someModelClassWithMethod, "theMethodToCall(20,11)");
// With BindingUtils.....
// bind host: standInHost
// bind property: "theMethodToCall(20,11)"
Of course, you nee to create such a utlity to help support such functionality beyond the basic Flex prescription. It seems many of such (more advanced) Flex bindings are usually done at compile time, but now you have to create code to do this at runtime in a completely cross-platform Actionscript manner without relying on the Flex framework.

Resources