views:

106

answers:

0

Hello!

I have a HP iPAQ rx5720 with Windows Mobile 5.0. I'm using AxHost code from http://msdn.microsoft.com/en-us/library/aa446515.aspx. This control works great in a ScreenOrientation angle of 0º or 180º (portrait). But it doesn't work if the orientation is 90º or 270º (landscape). By the way, I'm using the control to play videos with Windows Media Player.

I've debuged the code and it freezes at line 204 in AxHost Class of HostingLibrary. The method that has "the problem" is this:

public int DoVerb(int verb)
{
   Control control = this;

   return GetOleObject().DoVerb(verb, IntPtr.Zero, this.oleSite, -1, 
       (control != null) ? control.Handle : IntPtr.Zero, 
       AxHost.FillInRect(new COMRECT(), base.Bounds)); 
}

It so strange: the first time it's called the value of base.Bounds is {200, 200}. There is something happening around the way my PDA put landscape mode because this code works perfectly in emulator in portrait and landscape mode.

Any advice? The application uses .Net Compact Framework 2.0 SP2, C# and Windows Mobile 5.0 and it runs well on Emulator in landscape mode.