Solved: Microsoft Help: IEExe.exe and STA

Discussion in 'ASP .Net' started by pfurb, Jan 21, 2004.

  1. pfurb

    pfurb Guest

    Hi.
    Thanks for all suggestions.
    I have finally solved the problem. The System.Windows.Forms.Timer
    fails because of the UI-operations it executes in my program. So the
    program crashes when it is being closed.

    The solution was to replace the System.Windows.Forms.Timer with an
    implementation of SetTimer and KillTimer.
    Now it works fine.

    ....
    int monitorTimer = SetTimer(this.Handle, 9999, 1000, 0);
    ....

    /--- Set timer
    [System.Runtime.InteropServices.DllImport("user32.dll")]
    extern static int SetTimer(System.IntPtr hWnd,System.UInt32
    iEvent,System.UInt32 iElapse, int iCallbackMustBeZero);

    //--- Kill timer
    [System.Runtime.InteropServices.DllImport("user32.dll")]
    extern static int KillTimer(System.IntPtr hWnd,int iEvent);

    //--- Timer static
    static int WM_TIMER = 0x0113;

    protected override void WndProc(ref Message m)
    {
    //--- Check if it is a timer process
    if (m.Msg == WM_TIMER)
    {
    )
    base.WndProc(ref m);
    }


    br/
    peter
     
    pfurb, Jan 21, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pfurb

    Microsoft Help: IEExe.exe and STA

    pfurb, Jan 19, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    600
    Jeff B.
    Jan 20, 2004
  2. Charles A. Lackman
    Replies:
    1
    Views:
    1,464
    smith
    Dec 8, 2004
  3. SpamProof
    Replies:
    0
    Views:
    657
    SpamProof
    Oct 21, 2003
  4. Michael Bacarella
    Replies:
    26
    Views:
    1,424
    harri
    Nov 20, 2007
  5. Anthony Jones

    STA object in Session and Thread Affiliation

    Anthony Jones, Feb 6, 2006, in forum: ASP General
    Replies:
    12
    Views:
    249
    Anthony Jones
    Feb 11, 2006
Loading...

Share This Page