Exit Application FPM_CLOSE

Hi,
I'm using FloorPlanManager within ESS on EHP5, so I can only change the configuration using SERVER/sap/bc/webdynpro/sap/configure_component.
I added a Logoff button with FPM_CLOSE event. This works fine as far at it closes the current window. But the session is still open and a user is able to reopen the application without authentication.
I read some threads that the Logout-page is processed if FPM_CLOSE event is fired but this is not working in my scenario.
Any hints?
Regards,
Joschua

Hi Joschua,
I've searched everywhere for the answer to this.  I too have added my own FPM_CLOSE logoff button to a standalone FPM application, as it was (quite rightly) not considered enough for the user to just close the Internet Explorer tab.  As you say, the user is able to re-open the application without authentication as long as Internet Explorer was not shut down completely.
What I was trying to do was to add some Javascript (see below) to my own logoff page, but I wasn't able to replace the standard logoff page with my own.
<body on load="document. exec Command( 'Clear Authentication Cache' );">
(the syntax isn't quite correct as the forum doesn't allow the correct syntax to be posted).
I raised a message with OSS on 01/12/2011, and despite chasing it up twice I have not even had so much as an acknowledgement back from them.  As far as I'm concerned this is a huge omission from the standard in not being able to log off cleanly from a FPM application.
Good luck!
Pete

Similar Messages

  • Spool disappears in SP01 after exception raised or exiting application, but remains during LEAVE TO SCREEN '0'.

    Hi Experts,
    I'm using FMs SSF_OPEN and SSF_CLOSE to display multiple smartforms. After SSF_CLOSE the spool appears in SP01, when I exit the application (exit application and debugger) or raise an exception after FM SSF_CLOSE, the spool disappears from SP01.
    But if after SSF_CLOSE, I put SET SCREEN '0'. LEAVE SCREEN - which supposedly should exit the program, the spool is not being deleted from SP01.
    My question is, is there any way to commit the spool in SP01 even if I close the application or raise an exception? Should the code "COMMIT WORK", work for this requirement?
    Thanks in advanced,
    Jack.

    Hi All,
    I've solved this using COMMIT WORK

  • Pocket slow down after exit application

    Hi,
    I have an application that runs normally in a Pocket PC, Windows Mobile 2003, 64 MB RAM. But when i exit application, the Pocket almost freezes ! Sometimes I need to inicialize Pocket again.
    I exit my application this way:
                ConnectDB.disconnect(); 
                try{
                    Config.getClientSocket().getSocket().close();  //Finish Socket connection with server application
                }catch(IOException e){
                    MsgDialog msg = new MsgDialog(this, true, "Falha ao encerrar conex�o ", MsgDialog.MSG_WARNING);
                    msg.dispose();
                new Thread(){  
                    public void run(){
                        try{
                            sleep(400);
                        }catch(InterruptedException e){
                }.start();
                System.exit(0);           I have two threads I've created running at this moment. Could it be a problem for Pocket performance after exit application ?
    Thanks !

    Hi,
    I have an application that runs normally in a Pocket PC, Windows Mobile 2003, 64 MB RAM. But when i exit application, the Pocket almost freezes ! Sometimes I need to inicialize Pocket again.
    I exit my application this way:
                ConnectDB.disconnect(); 
                try{
                    Config.getClientSocket().getSocket().close();  //Finish Socket connection with server application
                }catch(IOException e){
                    MsgDialog msg = new MsgDialog(this, true, "Falha ao encerrar conex�o ", MsgDialog.MSG_WARNING);
                    msg.dispose();
                new Thread(){  
                    public void run(){
                        try{
                            sleep(400);
                        }catch(InterruptedException e){
                }.start();
                System.exit(0);           I have two threads I've created running at this moment. Could it be a problem for Pocket performance after exit application ?
    Thanks !

  • ConnTrans in TaskScheduler Unable to inizialize, exiting application...

    Hi,
    I scheduled a task in Windows Taskscheduler in order to automate the ConnTrans for a Mobil Sales user.
    The syntax in the batch is
    ConnTrans.exe /auto /forceclose /operations=3
    That work fine, if the console is not locked. But if the console has locked, the
    ConnTrans didn't start. After unlocking the console I get the following message
    Unable to inizialize, exiting application...
    Can somebody help me ?
    Many thanks in advance
    Julian

    Hi Julian,
    There is a special executable ConntransService.exe provided for situations similar to your requirement. Please use it instead of Conntrans.exe.
    Cheers,
    Ankan

  • Windows Mail can receive but not send until exiting application

    Hi, and thanks for taking time to read this as I&rsquo;m in need of your help.
    I have a Toshiba P200, Vista Home Premium, Tiscali as my ISP, Norton Internet Security for AV and firewall, and am accessing my broadband via Ethernet to a Belkin ADSL router (and occasionally a Siemens router) and I&rsquo;m experiencing some strange happenings with Windows Mail.
    In short I can receive mail with no problems, but when I send the mail it stays in the outbox despite the Send Immediate option being checked or pressing the Send/Receive button. When I exit Windows Mail the mail is sent straight away, and is in the Sent Mail folder when I restart Windows Mail.
    So why do I think there&rsquo;s a problem with the laptop. Well, I&rsquo;m fortunate enough to have a friend who has an non-Toshiba laptop, where all of the above can be replicated. Guess what, Windows Mail sends the mail exactly as it should (on my Tiscali account and on my network, through my router and ISP etc.), so I conclude that the only difference is that my laptop is a P200.
    I have called Tiscali who confirmed that all my Mail settings were OK, POP, SMTP etc, which I&rsquo;d expect (as they work on my friend&rsquo;s laptop), and they advised I contact Microsoft, which I did, and since the P200 has Vista pre-installed they say I have to contact Toshiba, and here I am.
    My P200 has been restored to factory settings, and I have tried to get this working without Norton IS, and no firewalls (Vista and router), but no luck.
    Any ideas would be much appreciated and if I find out by other means, I&rsquo;ll post back with outcome. If the answer is already out there, I apologise for being too dumb to locate it and beg your patience.
    Many thanks.

    Hi
    It is typical for support people. Every of them try to send the customers away and the reason should be by them. In my opinion Microsofts reaction is strange for me. They have designed operating system and they should be responsible for the functionality.
    I have Satellite A200 and Satellite P200D and I use Windows Mail on both of them successfully. My notebook is connected to WLAN router and router directly to the phone line. To be honest I have configured Windows Mail like you and all job were done in few minutes.
    It is not easy to say where the problem can be but I believe there is some problem with some settings on your notebook. Some of them block it somehow. To compare your, with friends notebook is also not the best because he can have completely different OS settings (antivir application, firewall settings).
    Try to disable all features who can block Windows hotmail to see if there is some difference.

  • Exit application with button

    hi...i need to close the main frame when user key in the correct username and password.when user do a mouse click o key press,the userinput box will show and with correct input the application will exit.my problem now is i need to click the ok button twice then application will exit.why is this so?how can i do to make it work with one click on the button?thanks

    oh ya i got two actionlistener...erm...
    my codes pretty long because i put everything into a class...sorry...
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    public class WindowTest
         public static void main(String args[])
              new WindowTestWindow();
    //create a black screen
    class WindowTestWindow extends JWindow
         WindowTestWindow()
              super();
              // Components should be added to the container's content pane
              Container cp = getContentPane();
              addKeyListener(new KeyAdapter() //for key press
                   public void keyTyped(KeyEvent event)
                        char key = event.getKeyChar();
                        if (Character.isLetterOrDigit(key))
                             PasswordBox pw = new PasswordBox(); // show the frame for user to input
                             pw.setVisible(true);                                        //username & password
                   public void keyPressed(KeyEvent event){}
                   public void keyReleased(KeyEvent event){}
              addMouseListener(new MouseAdapter() //for mouse click
                   public void mouseEntered(MouseEvent event){}
                   public void mouseExited(MouseEvent event){}
                   public void mouseClicked(MouseEvent event)
                        PasswordBox pw = new PasswordBox(); // show the frame for user to input
                        pw.setVisible(true);                                        //username & password
                        //System.exit(0);
                   public void mousePressed(MouseEvent event){}
                   public void mouseReleased(MouseEvent event){}
              //get screen size
              Toolkit kit = Toolkit.getDefaultToolkit();
    Dimension screenSize = kit.getScreenSize();
              // Show the frame according to the user's window size
         int screenHeight = screenSize.height;
         int screenWidth = screenSize.width;
         setSize(screenWidth, screenHeight);
              //set background color black
              cp.setBackground(Color.black);
              // Show the frame
              setVisible(true);
              requestFocus();
    //class to exit the whole     application
    class CloseActionHandler implements ActionListener
         public void actionPerformed(ActionEvent e)
              WindowTest w = new WindowTest();
              dispose();
              System.exit(0);
    //user to input username & password
    class PasswordBox extends JFrame
         private JTextField username;
         private JPasswordField password;
         private JButton ok, cancel;
         private JFrame PasswordBox;
         public PasswordBox()
              super("Unlock Screensaver"); //set the frame size
              setSize(280,120);
              JPanel backPanel = new JPanel();
              backPanel.setLayout(new BorderLayout());
              backPanel.setBackground(Color.blue);
              JPanel panel = new JPanel();
              username = new JTextField(5);
              panel.add(new JLabel("Username:", JLabel.RIGHT));
              panel.add(username);
              password = new JPasswordField(5);
              panel.add(new JLabel("Password:", JLabel.RIGHT));
              panel.add(password);
              backPanel.add(panel, BorderLayout.CENTER);
              JPanel OKPanel = new JPanel();
              ok = new JButton("OK");
              //ok.addActionListener(this);
              OKPanel.add(ok, BorderLayout.WEST);
              //add listener to the 'ok' button
              ok.addActionListener(new ActionListener()
              public void actionPerformed(ActionEvent e)
                   if(e.getSource() == ok)
                        if(username.getText().trim().equals("fyp"))
                             if(password.getText().trim().equals("fyp"))
                                  CloseActionHandler cah = new CloseActionHandler();
                                  ok.addActionListener(cah);
                             else
                                       clearInputFields();
              JPanel CANCELPanel = new JPanel();
              cancel = new JButton("CANCEL");
              //cancel.addActionListener(this);
              CANCELPanel.add(cancel, BorderLayout.EAST);
              JPanel buttonPanelss = new JPanel();
              buttonPanelss.add(OKPanel);
              buttonPanelss.add(CANCELPanel);
              backPanel.add(buttonPanelss, BorderLayout.SOUTH);
              setContentPane(backPanel);
              // Center the box
         Dimension screenDim =
    Toolkit.getDefaultToolkit().getScreenSize();
         Rectangle frameDim = getBounds();
         setLocation((screenDim.width - frameDim.width)
              / 2,(screenDim.height - frameDim.height) / 2);
         public void clearInputFields()
              username.setText("");
              password.setText("");
    thanks

  • Urgent: "Exit" in MainMenu Does Not Exit Application Right Away, Why?

    Hello All,
    We have many forms accessible from the MainMenu. I recently modified two forms (Form-a & Form-b) by using the CALL_FORM built-in in Form-b to call Form-a to allow users to return to Form-b with previous parameters and query search results. After the change implementation, all works okay except now our users sometimes have to hit the “EXIT” button in the MainMenu to exit the application more than several times(five times in one case I know of). The following is the PL/SQL code for “EXIT” in the MainMenu:
    BEGIN
      --check_update;
      IF :GLOBAL.SESSIONS > 1 THEN
        REMOVE_SESSION;
      END IF;
      DO_KEY('EXIT_FORM');
    END;Any thoughts/suggestions on this?
    Thanks in advance,
    Jinlan
    --

    hi
    try something like this.
    BEGIN
      --check_update;
    :global.sessions :=null;
      IF :GLOBAL.SESSIONS > 1 THEN
        logout;
      END IF;
    do_key(' exit_form'); -- you have to press F4 to exit
    END;If its Correct/Helpful please mark it. Thanks.
    Sarah
    Edited by: S@R@h on Nov 3, 2009 8:55 PM

  • Shared Dll unable to exit application.

    My application is using a shared dll generated by labview. When I attempt to exit my applicaiton hangs. I verified a normal exit without the labview dll.  This is a statically linked lib and the module is functioning properyly otherwise.
    Thanks in advance,
    zeekial

    Hi zeekial,
    Are you using your application in development mode or as an executable? And that's running on a PC connected to this sb rio over the network? And the application runs fine - the only problem is the shutdown?
    Jeff | LabVIEW Software Engineer

  • WD navigation - Exiting application back to calling screen.

    Hi Gurus,
    Simple WD question. I'm developing an "exit" button that would enable the program to navigate back to the calling screen which is either an Iview or a UWL message.
    I tried finding snippet, tuts and reference codes but couldn't any.
    Is there any API or methods that enable me to retrieve the calling URL of the application? Or do I need a few more steps to generate/retrieve those URLs?
    Any gurus kind enough to help? Thanks alot!
    Regards,
    Jansen

    Janson,
    Try using Exit plugs to accompolish your requirement.
    1. In the Web Dynpro explorer expand the node <WD project> – Web Dynpro Components – <YourComponent> – Component Interface – Interface Views – <YourComponent>InterfaceView and then double-click on it.
    2. Select the tab "Plugs".
    3. Add a new outbound plug of type "Exit plug" (Mark checkbox "Exit Plug" in the window that pops up for the New Outbound Plug) and name it as "AppExit" and choose Next.
    4. By clicking "New", add a new parameter with name <b>Url</b> (Use exactly the same name Url) of type
    <b>String</b> and choose Finish.
    Now add the interface view controller usage to the required view from which you have to exit and go back to a URL.
    1. Select the Web Dynpro Components – <YourComponent> – Views – <YourView>.
    2. Select the Properties tab.
    3. Add the required usage of the controller <YourComponent>InterfaceView.
    Then, create a button in your view (say "Back") and associate it to the event / action handler.(say, onActionExit).
    In the  event handler write the code like this:
    public void onActionExit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent)
        // controller
        wdThis.wdGet<YourComponent>InterfaceViewController()
    .wdFirePlugAppExit(<<i>TargerURL</i>>);
    Please note that upon exiting, all the involved components will be destroyed automatically by the WD runtime.
    All the aforementioned points are available in the standard tutorial
    <a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/inter-application-navigation%20in%20web%20dynpro.pdf">Inter-Application-Navigation</a>
    You may refer the same for any further assistance.
    Bala

  • Exit application on system shutdown

    Hello all
    I wrote an application (LV 7.0) using a queued state machine. For the most part elements are enqueued in an event-structure.
    As a part of the program I write acquired data into a database (local). This DB is copied to a network-drive when the program is started and regularly finished (using an "Exit"-Button on the front panel). The user often shuts down the system without exiting the program, so the DB is not saved. To avoid this loss of data I use the event "Application Exit?". After enqueueing a "Exit"-element I wait for the "Exit"-Case (which is the same as if the Exit-button was pressed) to be executed. Afterwards SilentShutdown is set True and Discard is set false.
    To test this functionality I ran the program an
    d shut down the system (WinXP). The program finishes as expected and the DB is copied to the network-drive.
    Although the program has finished correctly the system does not shut down and I have to shut it down once more.
    Does anyone know how to fix this problem?
    Thanks for your help.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

    hello thomas
    i've seen this behaviour on machines running XP without a LV-installation. does your machine shut down at the first attempt when your app is not running? if not so i would refer to Microsoft.
    otherwise:
    does LV start any services? check the task manager for running services and applications after your first attempt to shut down the system. maybe you could try to change the shut down timeout settings for applications and services in your registry. i think the default is 60 secs.
    greetings
    chris
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • Problem exiting application

    I have an aplication that I have been working on in flash CS4, it is an air application. When I close the application using the main windows close button it appears to close but is still running when I look at processes.
    If I close it by calling exit from the main menu it closes properly. I guess I am probably missing something obvious but I am not sure what.
    I set up a listener for the application
    NativeApplication.nativeApplication.addEventListener(Event.EXITING,onExiting);
    and I setup a loop in the onExiting function to dispatch a closing event to application windows check to see if it's prevented and if not close the window.
    However on testing the onExiting function is not being called when I close the application from the main window clsoe button, only form when I use the menu.
    To try and see what is causing the problem I did a trace on the loop for open application windows. there are 2 one is the main program and the other is untitled both are normal windows. Since only use one window in my application I don't understand why there are 2. But I guess it's the unclosed window that is keeping the program from closing.
    any help will be appreaciated.

    Ok this is really really frustrating. This blo*dy forum system is cr*p I have lost my message three times and if this gets through its a miracle.
    anyway my message
    It is beginning to look like a but in AIR or flash CS4, I have stripped the program I was working on down to a window, an event listener and a function to handle the event.
    here is the contents of the wizard.as file
    package {
        import flash.display.*;
        import flash.events.*;       
        import flash.display.NativeWindow;
        import flash.desktop.NativeApplication;
        public class wizard extends Sprite {       
            public function wizard():void
                NativeApplication.nativeApplication.autoExit = true;           
                NativeApplication.nativeApplication.addEventListener(Event.EXITING, onExiting);
                trace("setting listener");
            function onExiting(e:Event):void
                trace("exit called for ");                       
    I will try to attach the files but it has not work 3 times so far.
    When I close the wizard via the close button I get intermittent operation of the event, it works about 1 in 10 times I run the program. I have not been able to tell when it will or will not work.
    here is the output
    when it works
    [SWF] wizard.swf - 2040 bytes after decompression
    setting listener
    exit called for
    Test Movie terminated.
    when it doesn't
    [SWF] wizard.swf - 2040 bytes after decompression
    setting listener
    Test Movie terminated.

  • Mac Mail 'Sent' Folder Column Settings get lost after exiting application

    In Mac Mail, I have set the columns I'd like to view in my 'Sent' folder to "To", "Subject" and "Date." Those are the only fields I need to see in that folder. It is NOT a smart folder. If I exit Mail with the 'Sent' folder open, when I come BACK to Mail, the 'To' column has disappeared and the 'From' column has taken its place. Has anyone noticed and fixed this bug?
    On the up-side, Letterbox works just fine.

    You haven’t answered what type of mail account is this (POP, IMAP, .Mac)...
    Report the names of the files and folders present at the first level of the ~/Library/Mail/ folder in the Finder.
    In order to post the exact file names and avoid typing mistakes, proceed as follows. In the Finder, go to ~/Library/Mail/. With that folder open, if you’re looking at it in View > as List mode, first collapse any expanded folders so that the Finder only shows the files and folders at the first level of ~/Library/Mail/. Now, do Edit > Select All (⌘A), then Edit > Copy (⌘C), and paste it in your reply to this post.
    Before actually posting that information, edit it so that the file/folder names do not reveal any details you should keep private, e.g. replace any real username with “username” to hide your real email address. Try to be consistent in how you disguise those details, though, as we may need to refer to them in subsequent posts.
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder, i.e. ~/Library is the Library folder within the user’s home folder.

  • Opening multiple reports in Crystal Reports for VS causes database connect limit to be reached.  Seems to be no way to force Crystal Reports to close database connection (other than exiting application)

    I am working on upgrading an application that has been in use for many years.  The application is written in VB6 and I have been tasked with upgrading the current application to Crystal Reports for Visual Studio.  I am using Crystal Reports for VS Version 13.0.12.1494.  The system's database is a Sybase SQL Anywhere 16 database with an ODBC connection using integrated login.  Each of the reports has the database connection set up from within the report.  There is only once database server, so each of the reports are pointing to the same DB.  The database server is currently installed as a "Personal Server" with a limit of 10 connections. 
    I have implemented the CR viewer as part of a COM-callable wrapper that exposes a COM interface for VB6 to interact with.  Inside of my viewer component is a Winform that embeds the Crystal's Report viewer.  The COM interface basically maps the basic Crystal apis to methods that the VB6 can call (i.e., Load Report, Set Field Text, Update SQL Query, etc).  This architecture is working as designed and the reports are displaying correctly and responding correctly to changes in queries, etc.
    The issue is that after I open 9 reports, the tenth one will respond with an error indicating that the database connection limit has been reached.  The database connections used by the reports aren't released until after the application is closed.  The application is designed for a secure environment that prohibits the non-administrative user from accessing the systems desktop, so asking the user tor restart the application after 10 reports isn't a viable option.
    I have checked and database connection pooling is turned off for the SQL Anywhere 16 driver.
    I have been digging on this for a few days and have tried adding code in the FormClosed event to close and dispose of the Report Document as follows:
    ReportDocument reportDoc= (ReportDocument) crystalReportViewer1.ReportSource;
    reportDoc.Close();
    reportDoc.Dispose();
    GC.Collect();       // Force garbage collection on disposed items
    I have also tried the following (as well as maybe 20 or so other permutations) trying to fix the issue with no success.  
    ReportDocument reportDoc= (ReportDocument) crystalReportViewer1.ReportSource;
    foreach (Table table in reportDoc.Database.Tables)
         table.Dispose();
    crystalReportViewer1.ReportSource = null;
    reportDoc.Database.Dispose();
    reportDoc.Close();
    reportDoc.Dispose();
    reportDoc = (ReportDocument)crystalReportViewer1.ReportSource;
    GC.Collect();       // Force garabe collection on disposed items
    Any ideas or suggestions would be greatly appreciated.  I have been pulling my hair out on this one!

    Hi Ludek,
    Thanks so much for the quick reply.  Unfortunately I did not have time to work on the reporting project Friday afternoon, but did a quick test this morning with some interesting results.  I'm hoping if I describe what I'm doing, you can show me the error of my ways.  This is really my first major undertaking with Crystal Reports.
    If I simply load the report, then close and dispose, I don't hit the limit of 10 files.  Note that I do not logon manually in my code as the logon parameters are all defined within the reports themselves.  The logon happens when you actually view the report.  Loading the report doesn't seem to actually log in to the DB.
    What I did was create a very simple form with a single button that creates the WinForm class which contains the Crystal Viewer.  It then loads the report, sets the ReportSource property on the CrystalReportsViewer object contained in the WInForm and shows the report. The report does show correctly, until the 10 reports limit is reached.
    The relevant code is shown below. More than I wanted to post, but i want to be as complete and unambiguous as possible. 
    This code displays the same behavior as my earlier post (after 10 reports we are unable to create another connection to the DB).
    // Initial Form that simply has a button
      public partial class SlectReport : form
            public SelectReport()
                InitializeComponent();
            private void button1_Click(object sender, EventArgs e)
                ReportDocument rd = new ReportDocument();
                ReportForm report = new ReportForm();
                try
                    rd.Load(@"Test.rpt");
                    report.ReportSource = rd;
                    report.Show();
             catch (Exception ex)
                  MessageBox.Show(ex.Message);
    // The WinForm containing the Crystal Reports Viewer
        public partial class ReportForm : Form
            public ReportForm()
                InitializeComponent();
            private void Form1_Load(object sender, EventArgs e)
                this.crystalReportViewer1.RefreshReport();
                this.FormClosed += new FormClosedEventHandler(ReportForm_FormClosed);
            void ReportForm_FormClosed(object sender, FormClosedEventArgs e)
                ReportDocument rd;
                rd = (ReportDocument)crystalReportViewer1.ReportSource;
                rd.Close();
                rd.Dispose();
            public object ReportSource
                set { crystalReportViewer1.ReportSource = value; }
    Again, any guidance would be greatly appreciated. 

  • CUDA SafeHandle ObjectDisposedException when exiting application

    I'm having trouble using the SafeHandle for my unmanaged P/Invokes using the CUDA library. My problem is following. I
    have created a CUDA P/Invoke library with two methods to create a CUDA context.
    public static extern CUresult cuCtxCreate(out CUcontext pCtx, CUctx_flags Flags, CUdevice dev);
    public static extern CUresult cuCtxDestroy(CUcontext ctx);
    Then to ensure the handle is closed when it's not needed anymore I createsd a CUcontext derived from a SafeHandle:
    /// <summary>
    /// Cuda Context Handle
    /// </summary>
    [SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode = true)]
    [SecurityPermission(SecurityAction.Demand, UnmanagedCode = true)]
    public class CUcontext : SafeHandleZeroOrMinusOneIsInvalid
    public CUcontext()
    : base(true)
    [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
    protected override bool ReleaseHandle()
    try
    if (!IsInvalid)
    CUDADriverAPI.cuCtxDestroy(this);
    catch
    SetHandleAsInvalid();
    return true;
    Then I wrote a small tester to see if the CUDA context gets released when closing the application:
    void Main()
    CUDADriverAPI.cuInit(0);
    // Get the device handle
    CUdevice aDeviceHandle = new CUdevice();
    CUDA.Assert(CUDADriverAPI.cuDeviceGet(ref aDeviceHandle, 0));
    CUcontext aContextHandle = null;
    // Create a context.
    CUDA.Assert(CUDADriverAPI.cuCtxCreate(
    out aContextHandle,
    CUctx_flags.CU_CTX_SCHED_AUTO | CUctx_flags.CU_CTX_MAP_HOST,
    aDeviceHandle
    The problem is that the ReleaseHandle of the SafeHandle gets called immediately after the last curly bracket which is OK. The problem is that the SafeHandle fires a ObjectDisposedException when calling cuCtxDestroy although the finalizer has not run before.
    My question is what exactly happens on the last curly bracket. If some internal CUDA objects has been created which subsystem is responsible to clean it after the application has been closed. This behaviour must be similar to the FileStream mechanism or anything
    else that deals with SafeHandles. If haven't got the magic behind it.
    One thing that came into my mind was that I use the same SafeHandle in the Create and Destroy method. In most of the examples a regular IntPtr was used. Maybe this is one of the problems since I don't know if the handle is marked as "destroyed" when
    I'm in the ReleaseHandle() method and I don't know if the marshaller will recognize this as object disposed.
    Thank you Martin

    Hi Fred,
    I looked it up in there reference code. The only problem is that most of the functions I want to dig in are marked as
    MethodImplAttribute(MethodImplOptions.InternalCall)where I'm not really able to look into. Regarding your concern to ask in the CUDA API forum I would say no. The API works fine unless I close the application. And I guess there is the problem. The CUDA subsystem shuts down earlier than the GC cleans up.As far as I know the SafeHandles where made so that this problem can be bypassed by letting the destructor of the object run earlier than the destructor of the object being finalized.So in fact this is a more general question also for all other implementations that need SafeHandle support.BestMartin
    msedi

  • How to make Exit button for Out-of-browser application

    Greetings all,
    This sounds so simple, yet I can't find anything about it.  I want to make an Exit button in a Silverlight 4 Out-of-browser application.  When the user clicks the button, the application is to quit or close or exit.  (The same effect as if the user clicks
    the red X icon in the upper right-hand corner of a window.)
    Any ideas will be appreciated.

    Jonathan --
    Yes, the word Page has taken on many meanings in the last 15 years.  I'll clarify.  When I make a simple Silverlight OOB (out-of-browser) application using Visual Studio 2010, I ask Visual Studio to Add New Item, then choose Silverlight Page.  Let's
    say I name it Page2.xaml.
    By default VS2010 already made another page for me, MainPage.xaml.
    Now, here is my need:  On the page called MainPage.xaml, I want to place a large button that says Exit Application.  When the user clicks that button, I want the application to end and the entire window to close.  This is the standard behavior in most traditional Windows
    applications, for example in Microsoft Word or Microsoft Excel or Microsoft Access.  In any of those traditional applications, the user can, from the menu, choose File/Exit.  If he does, then not only does the application quit, but also the window
    closes itself.  The user doesn't have to click the small red X icon in the upper right corner. 
    That simple behavior of almost all traditional Windows applications, large and small, is what I'm looking for in my simple Silverlight
    OOB applications:  An Exit command that quits the application and closes the window itself.
     Sorry for the confusion.  I really appreciate your help.  Any ideas?

Maybe you are looking for

  • Install weblogic 610 on solaris error

    hi : i am trying to install weblogic 610 pack 2 on solaris 2.8. when i start with sh weblogic610sp2_sol.bin -i console the following error occurs: Preparing to install... Preparing CONSOLE Mode Installation... ========================================

  • Sync from ATV to Itunes

    Ok my ATV shoe in the device list and it is streaming. How do I get movies I have downloaded on ATV to Itunes? Is it suppose to be automatic? Because stuff that is on my ATV is not showing up in Itunes. I can sync from Itunes to ATV but I a can seem

  • Include "Comments" as caption in slideshow?

    I am putting together a slideshow of vacation pictures. Is it possible to have iPhoto add captions to the pictures of what I type in the "comments" section? This would be more convenient than going into iMovie and adding captions, I think.

  • [OBIEE 10.3] kuiFormulaBlockingScript

    Hi, On page 58 of the Presentation Services Administration Guide there is an example of blocking a request based on a formula. But I can't get it to work against paint. Did anybody get this working? John

  • Permissions/ACL reporting

    Hi, Does anyone know of any software that will produce a report of a file system tree along with the permissions attached to each directory within the tree? Cheers, Stu