Bonjour à tous,
J'ai une WindowsForm qui contient un webBrowser.
Ce webBrowser affiche une page html (qui contient des fonctions js).
J'ai simplifier mon problème à ces quelques lignes dans une autre Form et me provoque la même erreur.
Je voudrais appeler une méthode js avec ma Form.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 MessageBox.Show("toto"); Object obj = _wbrows.Document.InvokeScript("test");//_nomFuncJavascriptAExec); MessageBox.Show(obj.ToString());Ces lignes fonctionnent lorsque je les appelle avec un compte administrateur MAIS lorsque je les appelle avec un compte basique seul le premier message s'affiche puis la console m'affiche :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 function test() { return true; }
Je ne comprends pas d'où viens le problème et mon admin réseaux ne le voit pas non plus.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 Exception non gérée*: System.NullReferenceException: La référence d objet n est pas définie à une instance d un objet. à System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate metho d, Object[] args, Boolean synchronous) à System.Windows.Forms.Control.Invoke(Delegate method, Object[] args) à System.Windows.Forms.Control.Invoke(Delegate method) à ProjectTmpPreviewPdf.GenerationPdfFromCommande.MyThreadClass.exec() dans C: \_projets\c#\ProjectTmpPreviewPdf\GenerationPdfFromCommande.cs:ligne 173 à ProjectTmpPreviewPdf.GenerationPdfFromCommande.ThreadFunction() dans C:\_pr ojets\c#\ProjectTmpPreviewPdf\GenerationPdfFromCommande.cs:ligne 150 à System.Threading.ThreadHelper.ThreadStart_Context(Object state) à System.Threading.ExecutionContext.runTryCode(Object userData) à System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCle anup(TryCode code, CleanupCode backoutCode, Object userData) à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionCon text, ContextCallback callback, Object state) à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, Co ntextCallback callback, Object state, Boolean ignoreSyncCtx) à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, Co ntextCallback callback, Object state) à System.Threading.ThreadHelper.ThreadStart()
Partager