Pour les professionnels de l’informatique > Forums - Accueil > Interoperability Conversations (Archived) > Internet ExplorerClass Visible property not working when InternetExplorerClass is instantiated in a web service
Poser une questionPoser une question
 

TraitéeInternet ExplorerClass Visible property not working when InternetExplorerClass is instantiated in a web service

  • mercredi 17 décembre 2008 11:07kpapa Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     A du code
    Hello,
    I'm trying to open a new Internet Explorer window each time a web method of a certain web service is called.
    The window seems to be created as I can see the process iexplore.exe in the task manager, but is always invisible even if I set Visible property of InternetExplorerClass instance to true.
    Below is the code I am using:

     [WebMethod] 
        public string OpenIE() { 
            ThreadStart ts = delegate 
                                 { 
                                     InternetExplorer ie = new InternetExplorerClass(); 
                                     ie.Visible = true
                                      
                                 }; 
            Thread t = new Thread(ts); 
            t.SetApartmentState(ApartmentState.STA); 
            t.Start(); 
            t.Join(); 
            return string.Empty; 
        } 

    The above code executes successfully and produces no exceptions.
    Does anyone know what the problem could be?
    Thanks


    Kostas Papakonstantinou

Réponses

Toutes les réponses