Erreur sur l'obtention du handler d'un activeX sans fenêtre.
sosekeyser
Messages postés14Date d'inscriptionmardi 26 août 2003StatutMembreDernière intervention25 mai 2009
-
24 mars 2008 à 11:46
koukin88 -
30 oct. 2012 à 17:14
Bonjour,
Je bosse sur un petit projet de lecteur vidéo, en winforms et en c#.
J'ai commencé mon lecteur sur visual studio 2005, en c#2.0.
J'utilise un activeX qui me lit la vidéo.
Ca marchait bien, jusqu'à ce que je passe sous visual studio 2008.
Je compile toujours avec le framework 2.0, ça compile bien, mais le projet ne se lance plus...
Voici où ca bloque: L'initialise mon activeX à la main, et l'ajout à la form de cette facon:
//// Initialisation de l'activeX
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.playerControl = new AxAXPlayerLib.AxAXPlayerControl();
this.playerControl.BeginInit();
this.SuspendLayout();
this.playerControl.Enabled = true;
this.playerControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.playerControl.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("playerControl.OcxState")));
this.playerControl.TabIndex = 0;
this.Controls.Add(this.playerControl);
this.playerControl.EndInit();
this.ResumeLayout(false);
Ca marchait bien, mais désormais, ça plante sur le "this.playerControl.EndInit();".
J'ai l'erreur suivante : Impossible d'obtenir le handle de fenêtre pour le contrôle 'AxAXPlayerControl'. Les contrôles ActiveX sans fenêtre ne sont pas pris en charge.
Et le détail :
à System.Windows.Forms.AxHost.InPlaceActivate()
à System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
à System.Windows.Forms.AxHost.CreateHandle()
à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
à System.Windows.Forms.AxHost.EndInit()
à Ineoms.CAP.Player.TestElecardLite.Form1..ctor() dans D:\Documents\Visual Studio 2005\Projects\TestElecardLite\TestElecardLite2008\Form1.cs:ligne 41
à Ineoms.CAP.Player.TestElecardLite.Program.Main() dans D:\Documents\Visual Studio 2005\Projects\TestElecardLite\TestElecardLite2008\Program.cs:ligne 17
à System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
à System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)