C++ COM Catch Return Events

I have been using the C++ COM iTunes Interface for a while in my application to import files into iTunes via the SDK.
This has been working fine for a couple of years now however I have come across an issue with the deployment of iTunes 9 and greater.
In some machines the iTunes hangs while converting a file and importing to a playlist if I close my application that links into it the convert and import completes fine, this is not on all machines but a couple of customers have raised this issue.
I was wondering if anyone has implemented some form of catching the return events instead of having to sit in a while loop constantly calling:
hr = spConvertOpStatus->get_ProgressValue( &progressValue );
till it is complete. Any help would be greatly appreciated on this issue.
Regards,
AP

Hi Jason-F,
I’ve found that when I raise COM events while Excel is in edit mode (e.g. a cell is being edited) the event is “lost”.  Meaning,
the VBA event handler is never called (even after the Excel edit mode is finished) and the call to the C# event delegate passes through and fails silently with no exceptions being thrown.
Do you mean you didn't raise EventOne event? EventOne handler like following?
' EventOne handler
Private Sub managerObj_EventOne()
Debug.Print "EventOne " & g_nCounter
g_nCounter = g_nCounter + 1
End Sub
After test your code, here is my screenshot
And here is my execute log in C# ComServerTest.
ManagerClass1/1/2015 5:48:11 PM
DoThreadWork()1/1/2015 5:48:12 PM
ManagerClass_EventOne()1/1/2015 5:48:17 PM
ManagerClass_EventOne()1/1/2015 5:48:22 PM
ManagerClass_EventOne()1/1/2015 5:48:27 PM
ManagerClass_EventOne()1/1/2015 5:48:32 PM
ManagerClass_EventOne()1/1/2015 5:48:37 PM
ManagerClass_EventOne()1/1/2015 5:48:42 PM
ManagerClass1/1/2015 5:49:56 PM
DoThreadWork()1/1/2015 5:49:56 PM
ManagerClass_EventOne()1/1/2015 5:50:01 PM
ManagerClass1/1/2015 5:50:04 PM
If i misunderstand you, please feel free to let me know.
Best regards,
kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • How to catch key events in JWindow???

    Can somebody please suggest me how do I catch key events in a JWindow. I tried without success with addKeyListener( ) method. My sample code is attached below. I've j2sdk1.4.2_03 in my PC.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class EventCatcher extends JWindow implements KeyListener {
         public EventCatcher() {
              super();
              Container c = getContentPane();
              setBounds(100,100,400,400);
              c.setLayout(new FlowLayout());
              JButton button = new JButton("Hello");
              c.add(button);
    addKeyListener(this);
    requestFocus();
    setVisible(true);
         public void keyReleased(KeyEvent ke) {
    System.out.println("**************");
         public void keyPressed(KeyEvent ke) {}
         public void keyTyped(KeyEvent ke) {}
         public static void main(String str[]) {
              new EventCatcher();
    Regards,
    Koushik

    Hi GraemeHook!
    This is Khurram. I tried your code on my problem that is 95% like this problem but it could not be solved.
    can u please take view on my code.
    I m trying to move a frame that extends from JWindow on runtime with Key Board Arrow keys. but this only works when I extend this MainApp class from JFrame, but not when from JWindow.
    can u please help me. I also posted my own topic but no one response so found it resambling to my problem.
    hoping to hear from u soon
    you can also tell me at my email address
    [email protected]
    thanks
    ===========================================================
    MainApp.java
    *MainApp.java
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class MainApp extends JWindow {
      static LocationManager appLoc = new LocationManager();
      public MainApp() {
        try {
          jbInit();
        catch(Exception e) {
          e.printStackTrace();
      public static void main(String[] args) {
       MainApp frm = new MainApp();
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            int width = screenSize.width;
            int height = 45;
              frm.setFocusableWindowState(true);
            frm.setFocusable(true);
            frm.setSize(width, height);
            frm.setLocation(appLoc.setAppAtBottomCentered(width, height));
            frm.setLocation(appLoc.moveAppUpward(100));
            frm.setVisible(true);
      private void jbInit() throws Exception {
        this.getContentPane().setBackground(Color.white);
         addKeyListener(new java.awt.event.KeyAdapter(){
          int moveSpeed = 4;//must be even
          public void keyPressed(KeyEvent e){
            //JOptionPane.showMessageDialog(null,""+e.getKeyCode());
             if(e.getKeyCode() == KeyEvent.VK_SHIFT)
              if(moveSpeed==4)
                moveSpeed = 12;
              else
                moveSpeed = 4;
            if(e.getKeyCode() == KeyEvent.VK_UP)
              setLocation(appLoc.moveAppUpward(moveSpeed));
            else if(e.getKeyCode() == KeyEvent.VK_DOWN)
              setLocation(appLoc.moveAppDownward(moveSpeed));
            else if(e.getKeyCode() == KeyEvent.VK_LEFT)
              setLocation(appLoc.moveAppToLeft(moveSpeed));
            else if(e.getKeyCode() == KeyEvent.VK_RIGHT)
              setLocation(appLoc.moveAppToRight(moveSpeed));
            else if(e.getKeyCode() == 107) {//NUMPAD '+' Key For Vertically Increasing
              setSize(appLoc.increaseSize(0,moveSpeed));
              setLocation(appLoc.updateLocation());
            else if(e.getKeyCode() == 109) {//NUMPAD '-' Key For Vertically Decreasing
              setSize(appLoc.decreaseSize(0,moveSpeed));
              setLocation(appLoc.updateLocation());
            else if(e.getKeyCode() == 61) {// '+' Key For Horizontal Increasing
              setSize(appLoc.increaseSize(moveSpeed,0));
              setLocation(appLoc.updateLocation());
            else if(e.getKeyCode() == 45) {// '-' Key For Horizontal Decreasing
              setSize(appLoc.decreaseSize(moveSpeed,0));
              setLocation(appLoc.updateLocation());
    }====================================================================
    LocationManager.java
    * LocationManager.java
        import java.awt.*;
        import java.awt.event.*;
        import javax.swing.*;
        import java.util.*;
        import java.sql.*;
    public class LocationManager {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        static Point newPoint = new Point();
        static Dimension newDim = new Dimension();
        static Dimension minDim = new Dimension();
        /** Creates a new instance of LocationManager */
        public LocationManager() {
        public LocationManager(int width, int height){
            this.setAppCenteredWithDim(width, height);
        public Point setAppCenteredWithDim(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = (sWidth-width)/2;
            newPoint.y = (sHeight-height)/2;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point setAppAtTopCentered(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = (sWidth-width)/2;
            newPoint.y = 0;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point setAppAtBottomCentered(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = (sWidth-width)/2;
            newPoint.y = (sHeight-height);
            return newPoint;
            //return new Point(this.x, this.y);
        public Point setAppAtRightCentered(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = 0;
            newPoint.y = (sHeight-height)/2;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point setAppAtLeftCentered(int width, int height){
            //Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
          newDim.width = width;
          newDim.height = height;
            int sWidth = screenSize.width;
            int sHeight = screenSize.height;
            newPoint.x = (sWidth-width);
            newPoint.y = (sHeight-height)/2;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point moveAppUpward(int step){
            newPoint.y -= step;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point moveAppDownward(int step){
            newPoint.y += step;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point moveAppToLeft(int step){
            newPoint.x -= step;
            return newPoint;
            //return new Point(this.x, this.y);
        public Point moveAppToRight(int step){
            newPoint.x += step;
            return newPoint;
            //return new Point(this.x, this.y);
        public Dimension increaseSize(int w, int h){
          minDim.width = 116;
          minDim.height = 56;
          newDim.width += w;
          newDim.height +=h;
          if(w==0 && newDim.height > minDim.height)
            newPoint.y -= h/2;
          else if(newDim.width > minDim.width )
            newPoint.x -= w/2;
          return newDim;
        public Dimension decreaseSize(int w, int h){
          minDim.width = 116;
          minDim.height = 56;
          if(newDim.width > minDim.width )
            newDim.width -= w;
          if(newDim.height > minDim.height)
            newDim.height -= h;
          if(w==0 && newDim.height > minDim.height)
            newPoint.y += h/2;
          else if(newDim.width > minDim.width)
            newPoint.x += w/2;
          return newDim;
        public Point updateLocation(){
          return newPoint;
            //return new Point(this.x, this.y);
    }===================================================================

  • RE: (forte-users) Confusion with return event

    Samer,
    The return event is delivered to the calling task, which is the window in
    your first test. It is not deliverd to the event loop of the service object
    unless the call to the processor originated in the event loop, which is the
    case in your second test. The output you get from the server is exactly as I
    would expect.
    You need the following code in you client:
    event loop
    postregister
    SomeService1.StartImmediate();
    when SomeService1.Proc.ProcessEvent_return do
    task.Part.Logmgr.Putline('ProcessEvents_return');
    when SomeService1.Proc.ProcessEvent_exception do
    task.Part.Logmgr.Putline('ProcessEvents_exception');
    end event;
    Note that this logoutput will not be written to a logfile, but will appear
    in the logwindow which is opened when you start a client application.
    Pascal Rottier
    Atos Origin Nederland (BAS/West End User Computing)
    Tel. +31 (0)10-2661223
    Fax. +31 (0)10-2661199
    E-mail: Pascal.Rottiernl.origin-it.com
    ++++++++++++++++++++++++++++
    Philip Morris (Afd. MIS)
    Tel. +31 (0)164-295149
    Fax. +31 (0)164-294444
    E-mail: Rottier.Pascalpmintl.ch
    -----Original Message-----
    From: Samer Kanjo [mailto:skanjoyahoo.com]
    Sent: Thursday, January 18, 2001 1:54 AM
    To: ForteUsers
    Subject: (forte-users) Confusion with return event
    I have observed some odd behavior when attempting to
    catch a return event for a method invoked using start
    task. I provided the primary classes I used during my
    test and some output produced by those classes at the
    bottom of this message.
    The SomeService1 class is used to create an
    environment visible service object and the Processor
    class is one of its members. The Processor class
    starts processing when one of two things happens: the
    SomeService1 timer ticks off 10 seconds or when
    SomeService1.StartImmediate is called directly by
    another entity. Either way StartImmediate is called to
    start processing.
    The provided output is the result of starting a test
    application and invoking StartImmediate from another
    object (I used a window) and then observing what
    happens when the timer ticks. As you can see the
    invocation from the window did not result in the
    return event being received. However, the return event
    was received when the timer ticked.
    According to the Forte documentation a return event
    will only be posted to the parent task's event queue.
    Since I am making a cross partition call, the window
    and service object are not really in the same task
    (Unless my assumption is wrong). That would explain
    why the window did not cause a return event to be
    generated but was an event generated but not caught
    and if so where did the event go?
    In SomeService2 class I added an event StartProcessing
    and moved the code from StartImmediate to the
    StartProcessing event case in the event loop and
    simply posted the StartProcessing event in
    StartImmediate. I performed the same test I used when
    testing SomeService1. The Traceback output is
    identical for the window invocation but the return
    event is received this time! Why?
    It seems that to guarantee the receipt of a return
    event an asynchronous task must be initiated from
    within an event loop. Is this correct?
    I do not understand this behavior does someone have
    any thoughts on this? How can you guarantee the
    receipt of a return event?
    Samer Kanjo
    OUTPUT FROM SOMESERVICE1
    StartTaskTest_cl0: processing loop listening
    StartTaskTest_cl0:
    Traceback:
    SomeService.StartImmediate at line 1
    TestWin.Display at line 4
    C++ Method(s)
    UserApp.Run at offset 105
    StartTaskTest_cl0:
    StartTaskTest_cl0: Start processing...
    StartTaskTest_cl0: Processing complete.
    StartTaskTest_cl0:
    Traceback:
    SomeService.StartImmediate at line 1
    SomeService.ProcessingLoop at line 9
    StartTaskTest_cl0:
    StartTaskTest_cl0: Start processing...
    StartTaskTest_cl0: Processing complete.
    StartTaskTest_cl0: ProcessEvents_return
    OUTPUT FROM SOMESERVICE2
    StartTaskTest_cl0: processing loop listening
    StartTaskTest_cl0:
    Traceback:
    SomeService2.StartImmediate at line 1
    TestWin.Display at line 4
    C++ Method(s)
    UserApp.Run at offset 105
    StartTaskTest_cl0:
    StartTaskTest_cl0: Start processing...
    StartTaskTest_cl0: Processing complete.
    StartTaskTest_cl0: ProcessEvents_return
    StartTaskTest_cl0:
    Traceback:
    SomeService2.StartImmediate at line 1
    SomeService2.ProcessingLoop at line 9
    StartTaskTest_cl0:
    StartTaskTest_cl0: Start processing...
    StartTaskTest_cl0: Processing complete.
    StartTaskTest_cl0: ProcessEvents_return
    SOMESERVICE1 CLASS
    begin CLASS;
    class SomeService1 inherits from Framework.Object
    has public attribute proc: StartTaskTest.Processor;
    has public attribute processing: Framework.boolean;
    has public method Init;
    has public method ProcessingLoop;
    has public method StartImmediate;
    has property
    shared=(allow=off, override=on);
    transactional=(allow=off, override=on);
    monitored=(allow=off, override=on);
    distributed=(allow=on, override=on, default=off);
    end class;
    method SomeService1.Init
    begin
    super.Init();
    processing = FALSE;
    proc = new;
    start task ProcessingLoop();
    end method;
    method SomeService1.ProcessingLoop
    begin
    timer : Timer = new;
    timer.tickInterval = 10000;
    event loop
    task.part.logmgr.putline('processing loop
    listening');
    timer.isActive = TRUE;
    when timer.tick do
    StartImmediate();
    when proc.ProcessEvents_return do
    task.part.logmgr.putline('ProcessEvents_return');
    processing = FALSE;
    when proc.ProcessEvents_exception do
    task.part.logmgr.putline('ProcessEvents_exception');
    processing = FALSE;
    when task.shutdown do
    exit;
    end event;
    end method;
    method SomeService1.StartImmediate
    begin
    task.part.logmgr.putline(task.traceBack());
    processing = TRUE;
    start task proc.ProcessEvents() where completion =
    event;
    end method;
    end CLASS;
    SOMESERVICE2 CLASS
    begin CLASS;
    class SomeService2 inherits from Framework.Object
    has public attribute proc: StartTaskTest.Processor;
    has public attribute processing: Framework.boolean;
    has public event StartProcessing;
    has public method Init;
    has public method ProcessingLoop;
    has public method StartImmediate;
    has property
    shared=(allow=off, override=on);
    transactional=(allow=off, override=on);
    monitored=(allow=off, override=on);
    distributed=(allow=on, override=on, default=off);
    end class;
    method SomeService2.Init
    begin
    super.Init();
    processing = FALSE;
    proc = new;
    start task ProcessingLoop();
    end method;
    method SomeService2.ProcessingLoop
    begin
    timer : Timer = new;
    timer.tickInterval = 10000;
    event loop
    task.part.logmgr.putline('processing loop
    listening');
    timer.isActive = TRUE;
    when timer.tick do
    StartImmediate();
    when self.StartProcessing do
    processing = TRUE;
    start task proc.ProcessEvents() where completion =
    event;
    when proc.ProcessEvents_return do
    task.part.logmgr.putline('ProcessEvents_return');
    processing = FALSE;
    when proc.ProcessEvents_exception do
    task.part.logmgr.putline('ProcessEvents_exception');
    processing = FALSE;
    when task.shutdown do
    exit;
    end event;
    end method;
    method SomeService2.StartImmediate
    begin
    task.part.logmgr.putline(task.traceBack());
    post StartProcessing;
    end method;
    end CLASS;
    PROCESSOR CLASS
    begin CLASS;
    class Processor inherits from Framework.Object
    has public method Init;
    has public method ProcessEvents where completion =
    (return = ProcessEvents_return, exception =
    ProcessEvents_exception);
    has property
    shared=(allow=off, override=on);
    transactional=(allow=off, override=on);
    monitored=(allow=off, override=on);
    distributed=(allow=off, override=on);
    end class;
    method Processor.Init
    begin
    super.Init();
    end method;
    method Processor.ProcessEvents
    begin
    task.part.logmgr.putline('Start processing...');
    task.Delay(msecs = 1500);
    task.part.logmgr.putline('Processing complete.');
    end method;
    end CLASS;
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    Yes, you're right. The return event is queued until the moment that you
    actually enter an eventloop. I stand corrected.
    Pascal Rottier
    Atos Origin Nederland (BAS/West End User Computing)
    Tel. +31 (0)10-2661223
    Fax. +31 (0)10-2661199
    E-mail: Pascal.Rottiernl.origin-it.com
    ++++++++++++++++++++++++++++
    Philip Morris (Afd. MIS)
    Tel. +31 (0)164-295149
    Fax. +31 (0)164-294444
    E-mail: Rottier.Pascalpmintl.ch
    -----Original Message-----
    From: Adamek, Zenon [mailto:ZAdamekpurolator.com]
    Sent: Thursday, January 18, 2001 6:13 PM
    To: Rottier, Pascal
    Cc: 'forte-userslists.xpedior.com'
    Subject: RE: (forte-users) Confusion with return event
    I think it is always safe to use start task with where complition = event
    clause before event loop. The reason is described in Forte Help in the
    Complition Clause index:
    "Requesting the return and exception events automatically registers the
    events for the calling task. When the asynchronous method completes or
    terminates, Forté adds the appropriate event to the calling task's event
    queue.
    This registration is unlike the event registration for the event statement.
    In the event statement, the event is registered just before the event
    statement is ready to process the event. In the start task statement, the
    return and exception events are registered when the task is started, even
    though it can be much later on that your application is prepared to wait for
    those events. Therefore, only the "parent" task that executes the start task
    statement is registered for the completion event of the started task."
    and some comments from "Forte Performance and Patterns" page 18:
    "When you use the where completion = event clause in the start task
    statement, Forte automatically buffer the return event until you register
    for it. Therefore, you do not need to worry about the child task completing
    before you register for its return event".
    Regards,
    Zenon
    -----Original Message-----
    From: Rottier, Pascal [SMTP:Rottier.Pascalpmintl.ch]
    Sent: Thursday, January 18, 2001 11:16 AM
    To: 'Samer Kanjo'; ForteUsers
    Subject: RE: (forte-users) Confusion with return event
    Yes, if you want the eventloop of the service object to be informed when
    the
    method on the processor class is invoked, regardless of who invoked it,
    then
    you should simply post an event as the last statement inside the method on
    the processor class.
    The return events are only used to inform a partent task that a child-task
    has completed. So, only the calling task receives the event, only if the
    calling task is inside an event-loop at the moment the child-task
    terminates
    and only if there really is a child task (method started using "start task
    Note, that the calling task doesn't have to be inside an event loop when
    the
    asynchronous call is made. It has to be inside an eventloop when the
    asynchronous task terminates. The following piece of code works just as
    well:
    SomeService1.StartImmediate();
    self.DoSomeOtherStuff();
    event loop
    when SomeService1.Proc.ProcessEvent_return do
    task.Part.Logmgr.Putline('ProcessEvents_return');
    when SomeService1.Proc.ProcessEvent_exception do
    task.Part.Logmgr.Putline('ProcessEvents_exception');
    end event;
    However, if the asynchronous task started from within "StartImmediate"
    finishes before the client gets a chance to enter its event loop, then
    you're too late to catch the event. That's why it's safer to use the
    "postregister" function, which makes sure a certain action is not started
    untill all events from the event loop have been registered.
    Pascal Rottier
    Atos Origin Nederland (BAS/West End User Computing)
    Tel. +31 (0)10-2661223
    Fax. +31 (0)10-2661199
    E-mail: Pascal.Rottiernl.origin-it.com
    ++++++++++++++++++++++++++++
    Philip Morris (Afd. MIS)
    Tel. +31 (0)164-295149
    Fax. +31 (0)164-294444
    E-mail: Rottier.Pascalpmintl.ch
    -----Original Message-----
    From: Samer Kanjo [mailto:skanjoyahoo.com]
    Sent: Thursday, January 18, 2001 5:04 PM
    To: ForteUsers
    Subject: RE: (forte-users) Confusion with return event
    Pascal,
    So you are confirming that a return event can only be
    received in an event loop if a task is started from
    within that event loop.
    After making your proposed changes I was able to
    receive the return event in the window.
    I originally wanted the SomeService event loop to
    always receive the return event regardless of whether
    or not StartImmediate is called by some other entity
    or called when the timer ticks. It seems that the only
    way to do this is with events. Is that correct?
    Thank you for insight,
    Samer Kanjo
    --- "Rottier, Pascal" <Rottier.Pascalpmintl.ch>
    wrote:
    Samer,
    The return event is delivered to the calling task,
    which is the window in
    your first test. It is not deliverd to the event
    loop of the service object
    unless the call to the processor originated in the
    event loop, which is the
    case in your second test. The output you get from
    the server is exactly as I
    would expect.
    You need the following code in you client:
    event loop
    postregister
    SomeService1.StartImmediate();
    when SomeService1.Proc.ProcessEvent_return do
    task.Part.Logmgr.Putline('ProcessEvents_return');
    when SomeService1.Proc.ProcessEvent_exception do
    task.Part.Logmgr.Putline('ProcessEvents_exception');
    end event;
    Note that this logoutput will not be written to a
    logfile, but will appear
    in the logwindow which is opened when you start a
    client application.
    Pascal Rottier
    Atos Origin Nederland (BAS/West End User Computing)
    Tel. +31 (0)10-2661223
    Fax. +31 (0)10-2661199
    E-mail: Pascal.Rottiernl.origin-it.com
    ++++++++++++++++++++++++++++
    Philip Morris (Afd. MIS)
    Tel. +31 (0)164-295149
    Fax. +31 (0)164-294444
    E-mail: Rottier.Pascalpmintl.ch--
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • Catching Custom Events in Actionscript

    I have a custom component that opens a new window with a video player in it. I need to pass a bunch of stuff into it, so there's a lot of binding expressions. I need to be able to catch it's complete event (when the video is finished playing). But the event I dispatch isn't working. Here's my custom component class:
    [CODE]
    <?xml version="1.0" encoding="utf-8"?>
    <!-- This is a window component which creates a transparent window with no system chrome (no bars, close, min, max buttons, resize stuff) that contains a single video object to be able to play videos from a folder called "videos" in the root of this application. This screen is spawned from the main MXML WindowedApplication using AS 3. -->
    <s:Window xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark"
                        xmlns:mx="library://ns.adobe.com/flex/mx"
                        xmlns:customComponents="customComponents.*"
                        systemChrome="none" visible="true" transparent="true" showStatusBar="false" width="400" height="300"
                        >
        <fx:Metadata>
            [Event(name="MOVIE_LOAD", type="flash.events.Event")]
            [Event(name="MOVIE_FINISH", type="flash.events.Event")]
        </fx:Metadata>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <s:layout>
            <s:BasicLayout />
        </s:layout>
        <fx:Script>
            <![CDATA[
                import org.osmf.events.TimeEvent;
                [Bindable]
                public var displayScreenWidth:int = 1024;
                [Bindable]
                public var displayScreenHeight:int = 768;
                [Bindable]
                public var videoName:String;
                // Note that the following two variables are set to true by default because the screen saver goes in first.
                [Bindable]
                public var muteVideo:Boolean=true;
                [Bindable]
                public var loopVideo:Boolean=true;
                // In order to allow it to play, I had to extend the play method for the VideoDisplay to a public function.
                public function play():void
                    videoDisplay.play();
                protected function dispatchMovieLoad(event:Event):void
                    var eventObj:Event = new Event("MOVIE_LOAD");
                    dispatchEvent(eventObj);
                protected function dispatchMovieFinish(event:TimeEvent):void
                    var eventObj:Event = new Event("MOVIE_FINISH");
                    dispatchEvent(eventObj);
            ]]>
        </fx:Script>
        <s:VideoDisplay id="videoDisplay" x="0" y="0" width="{displayScreenWidth}" height="{displayScreenHeight}" source="videos/{videoName}"
                                        autoPlay="true" muted="{muteVideo}" loop="{loopVideo}" complete="dispatchMovieFinish(event)" />
    </s:Window>
    [/CODE]
    When I try to catch the event, I use this code:
    [CODE]
    /* Plays a video, and enables sound and disables looping. It also defines what do to when the video reaches completion. */
    protected function playVideo(vidName:String):void
        videoScreen.addEventListener(Event.MOVIE_FINISH, loadScreenSaver);
        videoScreen.muteVideo = false;
        videoScreen.loopVideo = false;
        videoScreen.videoName = vidName;
        videoScreen.play();
    [/CODE]
    The problem is, i get the error by the addEventListener line that reads:
    Multiple markers at this line:
    -1119: Access of possibly undefined property MOVIE_FINISH through a reference with static type Class.
    -addEventListener
    I don't know how to get around this. When I type "addEventListener(" and hit control+space bar, I see "Event.MOVIE_FINISH" on the list, citing my custom component as the source. Even when I had it called movieFinish in the component, I still saw "MOVIE_FINISH" for my event in the code help. So, I changed the name, but I cannot get rid of the error, and therefore my program won't compile fully. Any ideas?

    The first argument to addEventListener() is just a string.  You can do:
        videoScreen.addEventListener("MOVIE_FINISH", loadScreenSaver);

  • AWTEventListener: Catch all events after events are invoked

    Hi,
    i read here about catching all event of my application: http://developer.java.sun.com/developer/qow/archive/19/index.html
    But: Is there a way to invoke my eventDispatched method after the
    current event was calling?
    For example: I need on selecting a Combobox the selected value, not the last
    selection.
    Thanks.
    Regards.

    Thanks for reply!
    I use an ItemListener on my ComboBox, but my problem was that the eventDispatched method was not
    called. I did it like this:
            getToolkit().addAWTEventListener(
             new AWTEventListener() {
                 public void eventDispatched(AWTEvent e) {
                  System.out.println(e);
             AWTEvent.ITEM_EVENT_MASK
            );Is that a problem of JDK1.4.1 ???
    So tried it with a AWTEvent.MOUSE_EVENT_MASK to check a combobox in my application
    is clicked. It works, but i get always the last selection von the combobox.
    74philip: Thanks for your solution, but my "code for the selected event here..."
    should be in the eventDispatched method. I cant change my app for any comboboxes.

  • How to catch an event when the user change values in the project information dialog

    hi,
    i would like to know how to catch an event in my C# code when the user change values in the project information dialog?
    taskChange doesn't catch these changes.
    thanks.
    Thanks, Sharon.

    You need to write save button event handler for project information dialog. Link is having same functionality described. 
    http://blogs.msdn.com/b/husainzgh/archive/2011/08/01/hooking-into-the-project-detail-page-ribbon-save-button-without-overriding-out-of-box-functionality-in-project-web-access-for-project-server-2010.aspx
    http://www.projectserver2010blog.com/2010/01/sharepoint-2010-webpart-client-server.html
    kirtesh

  • How to catch children events?

    Hi all!
    I have a problem. I thought it should be easy to implement, but I didn't found solution! :(
    The problem is a next one: I have a JFrame that contains some components inside like Panels, Buttons, ... But what I need is a catch all mouse movements inside JFrame even if the event was appeared over these components.
    Maximum what I could get is catch mose events over the empty space of JFrame.
    Is anybody know how to do it?
    Thank you!
    Vladimir

    Thank you,
    That's exactly what I going to do today, but look at this http://forum.java.sun.com/thread.jsp?forum=57&thread=170512&start=0&range=15
    That is what I searched for!
    Anyway thanks a lot for your cooperation!
    Best regards,
    Vladimir

  • Free of goods should not come in return process

    Dear sd gurus Have a good day
                     i have one requirement regarding free of goods suppose if we already given free of goods with main item like 10 pens 1 pen is free( 10 +1)
    generally when we do return process for particular document ( return order,return delivery,pgr,return billing)   free goods also will come automatically returns  but my requirement is only main item only should come in return process  not free of goods.bz after taking main item in return process due to damaged goods ,here only main item only should come not free of goods
    how i can achieve this ?
    thank you

    Venu,
    I did some searching in copy control (IMG), in view of your business requirement.
    In connection to my earlier post, "re-determination of Free goods" in RE order type;
    when RE order is created with reference to OR
    In VTAF, see item level TANN, copy control 302: Do not copy
    Here the free goods are not copied. Only goods with item category other than TANN are copied from billing document to RE order.
    Then if free goods determination is done afresh in RE order. If there is no free goods procedure assigned to RE sales document type, then no free goods are populated in RE order.
    I haven't tested this, you could test this and see if it meets your business requirement.
    From SAP, F1 help for copy requirement 302:
    In this requirement, any items that have this requirement assigned will not be copied into the target document.
    Example
    When using product selection, it is advisable that only the main item be allowed to be copied from document to document, and the sub-item should be re-determined in the target document based on the current availability situation. In order to implement this, the item category of the sub-item can have this copy routine assigned to it in order to prevent the copying of these items.

  • How to catch click event on BAR or a BAR GRAPH???

    Hello
    I want to implemnt following things,
    1. there is Bar Graph containing 10 Bars.
    2. So i want to navigate to 10 diff. pages on click of each bar.
    So how to catch click event on BAR or a BAR GRAPH.????

    Hi,
    You can set Destination URI on a graph. The URL can be specifically associated to a particular data point plotted in the graph.
    Detail for the same is provided in OAF developer guide under 'Charts and Graphs' topic.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Catching key events in application

    I have a JFrame with a JDesktop containing lots of JInternalFrame with various of components such as JTextFields etc.
    Now, i want to have a "main" listener that will catch key events no matter which component that has focus. For example pressing CTRL+A should produce something in the application no matter which component that has focus.
    How do I implement this in an easy way?

    It doesnt seem to work to add a KeyListener to the JFrame...
    this.addKeyListener(new KeyAdapter(){
                   public void keyTyped(KeyEvent e){
                        System.out.println("KeyTyped()");
                   public void keyPressed(KeyEvent e){
                        System.out.println("KeyTyped()");
              });Adding that to the JFrame gives nothing to System.out when a JTextArea inside an JInternalFrame has focus.

  • How to catch the event for change dropdown value in alv

    it has a column output by dropdown in alv. the dropdown type cl_salv_wd_uie_dropdown_by_idx.
    now the problem is if change the dropdown value, i want to catch the event to change another column value.
    how can i do it?

    This part contains other ALV initialization code
    *... init ColumnSettings
      DATA:
            lr_column_settings TYPE REF TO if_salv_wd_column_settings.
      lr_column_settings ?= wd_this->r_table.
      DATA:
            lt_columns TYPE salv_wd_t_column_ref.
      lt_columns = lr_column_settings->get_columns( ).
      DATA:
            ls_column     TYPE salv_wd_s_column_ref,
            lr_col_header TYPE REF TO cl_salv_wd_column_header,
            l_tooltip     TYPE string.
      LOOP AT lt_columns INTO ls_column.
        CASE ls_column-id.
          WHEN 'PLANETYPE'.
            DATA:
                  lr_drdn_by_key TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
            CREATE OBJECT lr_drdn_by_key
              EXPORTING
                selected_key_fieldname = ls_column-id.
            lr_drdn_by_key->set_key_visible( abap_true ).
            ls_column-r_column->set_cell_editor( lr_drdn_by_key ).
          WHEN OTHERS.
        ENDCASE.
    ENDLOOP.
      DATA:
            node_info TYPE REF TO if_wd_context_node_info,
            lt_valueset   TYPE STANDARD TABLE OF wdr_context_attr_value,
            l_value       TYPE wdr_context_attr_value.
      node_info = wd_context->get_node_info( ).
      node_info = node_info->get_child_node( 'FLIGHT_INFO' ).
    data : lt_sflight type STANDARD TABLE OF sflight,
           ls_sflight like LINE OF lt_sflight.
    SELECT * from sflight into TABLE lt_sflight.
    LOOP at lt_sflight into ls_sflight.
      l_value-value = ls_sflight-planetype.
      l_value-text  = ls_sflight-planetype.
      INSERT l_value into TABLE lt_valueset.
      ENDLOOP.
      node_info->set_attribute_value_set(
      name = 'PLANETYPE'
      value_set = lt_valueset ).

  • Where can we catch the event which leads to downloading a report to a local

    Hi frnds,
    can u help me out . actaully ,i  have a classical interactive report. it has many headings.Because of the initial headings ,if i try to download that report to a local file ,the column allignments are disturbed.
    So,one way i feel to get the download correctly ,is that ,some how i can catch the event whcih leads to the download of the report ,and based on the occurence of that event ,i can restrict the page headings to appear in the downloaded spreadsheet ,so that the there are no, unwanted columns getting inserted in between .
    Regards
    Rajesh.

    hi,
    you can have selection screen field : "parameters : p_disvar like disvariant-variant."  and at event selection scree you can call the below function and select the variant create for the report.
    "at selection-screen on value-request for p_disvar.
      call function 'REUSE_ALV_VARIANT_F4'
           exporting
                is_variant          = g_variant
              I_TABNAME_HEADER    =
              I_TABNAME_ITEM      =
              IT_DEFAULT_FIELDCAT =
                i_save              = g_variant_save
           importing
                e_exit              = h_exit
                es_variant          = gx_variant
            exceptions
                not_found           = 1
                program_error       = 2
                others              = 3.
      if sy-subrc is initial and h_exit is initial.
        g_variant-variant = gx_variant-variant.
        p_disvar          = gx_variant-variant.
      else.
        message id sy-msgid type 'S'
                     number sy-msgno
                     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    Atul

  • How to Catch Return Code(RFC) in  XI

    Hi
    Can any help me out,
    I have a scenario , which is posting the data into SAPR/3 through RFC and alternately I would like to catch the exceptions . I need to catch return code in my scenrio, which will be show successfully posted or not as E or U.
    My RFC returning the error codes like E, S, and U..so these error codes i need to catch and update into my DATABASE.
    This is scenrio , i need to do very urgent manner..please let me know, should i use schronous or fault message types?
    please give me logical steps for how to do this?
    If it sync messae type, please tell me what is the output message type and input message type..
    thank you,
    Regards..rambarki!

    Hi Rambarki,
    Just for your information I'll tell you what all you have to develop to complete this scenario.
    <b>1></b> Two datatypes. one for the Request(data coming from JDBC Sender) and one for the Response(data going through JDBC Receiver).
    <b>2></b> Two corresponding Messagetypes.
    <b>3></b> Five Message Interfaces.
              i) OutBound/Async with Request.
             ii) Abstract/Async with Request.
            iii) Abstract/Sync with Request and Response.
             iv) Abstract/Async with Response.
              v) InBound/Async with Response.
    <b>4></b> Message Mapping
              i) Message Mapping between the Request and imported RFC.
             ii) Mapping between RFC.Response and Response.
    <b>5></b> Single Interface Mapping with Source as Abstract/Sync interface and target as RFC with two mapping programs corresponding to Request and Response.
    <b>6></b> Integration Process
             i) Create container element for request and response interfaces.
            ii) Receive step(Asynchronous), Send step(Synchronous), Send step(Asynchronous).
    Receiver Determinations
    i)   JDBC --> Integration Process (imported from IR)(OutBInterface: OutBound/Async, InBnterface: Abs/Async)
    ii)  Integration Process --> R/3 (OutBInterface: Abs/Sync, InBInterface: RFC with mapping program)
    iii) Integration Process --> JDBC. (OutBInterface: Abs/Async, InBInterface: InBound/Async).
    Hope this works for you.

  • Catch Global Events

    Hi,
    i have a idea for a program. I want to catch all actions from the users. If the user performed this action with the mouse, i wanna show him a notification with the shortcut of this actions. For example: The user open with the mouse a new tab in Safari the program recognize this and show him a message "Hey you can do this with: Apple + T".
    I played around with the
    Code: 
    addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask
    but i can't find a connection to the Event that has been performed. Is there anybody with a idea how i can do this with build in classes from Cocoa/Objective-c?  Thank in advance for your help Greetings from Germany  Tobi

    Investigate Display.addFilter().
    "John Daly" <[email protected]> wrote in message
    news:c2800n$fdg$[email protected]..
    > How can I catch Global events in SWT. I want to carry out certain
    > functionality when the user pressed a certain button on the keyboard.
    >

  • ADF Faces EA15: table update not working properly after dialog return event

    Hi,
    in my application I have a table with read-only records and an edit button for each row.
    The button triggers a dialog where one field of of the record can be edited.
    The record is a bean which is put into processScope.
    After accepting the change in the dialog the bean makes an update in the database changing the order of the records in the table on the launching page.
    The return event triggers a re-rendering of the launching page (which I can see from the output of a phase listener) and the table model gets updated but the table output is not updated visually.
    However, if I call the dialog on another record I don't get the record I see in the table but instead I get the record which I'd expected if the table re-rendered properly.
    Do I have to trigger any kind of event on the table now so that the framework knows that a change has taken place and that the table has to be re-rendered? There is no difference whether I use PPR or not. It used to work in EA14.
    Thanks,
    Achim

    In EA14, the return from the dialog required a full-page refresh (whether the dialog was launched with PPR or not didn't matter). In EA15, it's done with PPR if possible. This avoids the flash (and re-scrolling, etc.), but means you do need to tell us what's going to get changed because of the return. You can use partialTriggers on the table with the "id" of the button to make this happen.

Maybe you are looking for