Bonjour

Dans le cadre d'un projet, j'essaie d'utiliser un ocx inclus dans un produit avec lequel nous développons.

Cet ocx a pour but d'afficher des documents de type word, pdf etc...

J'ai donc ajouté la référence dans mon projet (windows form C#), et j'ai ajouté l'ocx dans ma toolbox, et j'ai glissé le composant sur ma forme.

Cool me suis-je dis, ça fonctionne, j'ai accès aux méthodes de l'activeX en question et j'arrive à afficher des petits documents en guise de test.

Malheureusement, lorsque je fais un clic-droit sur le composant, il m'envoie une erreur du type :

System.AccessViolationException {"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."}
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsFormsApplication1.Program.Main() in C:\test\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Pour information, ce composant est utilisé dans son application native et lorsqu'on fait un clic-droit sur le viewer, un petit menu contextuel apparait et permet de faire différentes actions (zoom, fit, print etc...).

Quelqu'un peut-il me donner une piste pour essayer d'utiliser de meilleur manière cet ocx ou m'indiquer une cause possible de cette exception ?

Merci bcp