Flex/AS3 error I don't understand (net.registerClassAlias) - actionscript-3

On a large inherited project I am getting the error below. So far I haven't even found where the error is being triggered. I've searched on various terms (I'm using Flash Builder) and find no references to registerClassAlias and only one reference to DataItem (below).
I am assuming that _ShoppingCart_FlexInit is some internal Flex call.
Does anyone understand this error: what is causing it and how to resolve it? The suggestion to "define spark.utils.DataItem in the top-level application" isn't clear to me. Is that an #import?
warning: The class spark.utils.DataItem has been used in a call to
net.registerClassAlias() in _ShoppingCart_FlexInit. This will cause
modules:ShoppingCart to be leaked. To resolve the leak, define
spark.utils.DataItem in the top-level application.
DataItem reference:
<s:typicalItem>
<s:DataItem eventID = "eEventIDNum"
eventName="eEventName"
eventLocation="local"
eventText1="I am a very long text description"
eventLinkName="Summary"/>
</s:typicalItem>

Some code is auto-generated by the mxmlc compiler, so you could try to use the compiler option keep-generated-actionscript=true to find the registerClassAlias call.
To follow the suggestion you could just define a DataItem dummy variable in the top-level application.

Related

MS Access: Property defined with 'Form' return type in a interface gives user-defined type not defined compilation error

Looking for help writing an interface that has a property (or function) that returns an object typed as a "Form" (e.g. Access.Form as the return type).
Problem description:
The following simple example code returns a "User-defined type not defined" error if I attempt to compile the project.
I_TestInterface:
Public Property Get MyForm() as Form
End Property
cls_TestClass:
Implements I_TestInterface
Public Property Get I_TestInterface_MyForm() as Form
End Property
This is the only code/objects in a otherwise blank Access-2016 database and asking VBA to 'compile' produces a "User-defined type not defined" error. No lines are highlighted, it simply won't compile. Same occurs if replace 'Form' by "Access.Form"
My usecase is writing classes that wrap/hold a reference to a form internally - sometimes it is easiest to provide a reference to the underlying form so that consuming code can get at form properties without coding them all into the wrapper class.
Steps taken:
Lots of searches on 'user-defined type not defined' errors, in almost all cases this is due to a missing reference. Does not seem applicable since can create a standard module and happy to compile if write a function with a Form return type there. (*)
There was one previous SO thread on similar 'ambiguous' 'user-defined type not defined' error but I can't find it again and it wasn't specific to the 'Form' type in MS-Access
Have a clumsy workaround of providing property that returns an Object type that consuming code just has to cast to a Form (e.g. public property get MyFormAsObjectThatCanBeCastToForm() as Object).
(*). Possible clue? - if I just change the return types to object, the code still won't compile. I need to exit and use the 'de-compile' start up switch when relaunch Access. Then the above code with Object used as a return type is happily compiled.
Question / request:
Before I start re-installing Office, can others reproduce this?
Has anyone experienced this before? Developed a solution?
Thanks
PAHTDC

Unknown warning: "Member from unopened namespace"

Within my Pure AS3 app (using IntelliJ) I'm getting the following warning:
"Member from unopened namespace" associated with the instance of the model.
The initial instantiation of the Model is fine (singleton) but each reference to it within the class that it's instantiated after the constructor are throwing the above warning.
The model it's self appear fine as is instantiated without issue from multiple other view classes.
Has anyone come across this before? Interesting that neither SO or Google verbatim throws up any results.
as ever, all suggestions and help appreciated!

WiFiDirect::Close() method is missing in API for C++

I'm writing a C++/CX program that uses WiFiDirect. Target platform version is 10.0.10586.0. Everything works perfectly fine but one thing.
The problem is that there is no WiFiDirect::Close() method available, though it's mentioned in documentation.
The actual error I get is following:
Error C2039 'Close': is not a member of 'Windows::Devices::WiFiDirect::WiFiDirectDevice'
Does anyone know where I can find it?
Close is not projected for C++/CX; it is automatically called when the object's destructor is called (or when no more references are outstanding).
See the docs for IClosable:
Note to callers
Close methods aren't callable through Visual C++ component extensions (C++/CX) on Windows Runtime class instances. Instead, C++/CX code for runtime classes that wants to explicitly clean up a reference should call the destructor or set the last reference to null.

Flash Builder break on warning (of a binding error)?

I've injected some silly binding error in a large legacy project and am having trouble finding it.
This is the error output to the console:
warning: unable to bind to property 'length' on class 'String' (class
is not an IEventDispatcher)
I've tried stepping through with the debugger try to track down where this is happening but there are many thousands of lines of code and with event messaging, a very non-linear program execution.
Question: Is there any way to make Flash Builder break on a warning like this? If not, is there some other method, trick or hack for tracking this down?
This is caused by (wait for it...) trying to bind to a property that isn't marked as [Bindable]. In this case, you have a string variable whose length property is being used for data binding.
This is most likely caused by adding "myvar.length" as a property in the MXML tag for a component -- something like
<s:TextInput maxChars="{myInputString.length}" ...>
Flex will create the data binding for you automatically, but it doesn't realize at runtime that the property isn't Bindable - meaning, if there are changes to the property value the notification won't propagate to update the listeners.
Data binding uses mx.binding.PropertyWatcher to do the binding, and PropertyWatcher.updateParent is where the warning is output.

System.TypeInitializationException between two program in F#

I'm working on a project and I become always an Exception "TypeInitializationException".
I tried to give a string to a global string variable but it failed.
That's the code for the viewmodel and it failed on the second line
| {State = _}, ConsumablesClicked vm ->
Testtyp <- vm.TrackPosition.ToString()
That's on the other program
let mutable Testtyp = ""
I become this InnerException "Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.".
"The type initializer for '.$BarcodeGenerieren' threw an exception.", that's the exception explication.
Has someone a Idea how solve this?
That exception indicates that some code is trying to call Console.ReadKey when the standard input for that process has been redirected (see e.g. Allowing redirection of StandardInput of a C# application when doing "Console.ReadKey"). The solution is not to call Console.ReadKey, but it's not clear from your description where this is actually happening (perhaps in the static constructor for one of your types?).
I found the solution after a lot of try and it was only, that I had a Console.Readkey in my code, that I forgot to delete.
I had before a console apllication and I transformed it to be a class.