HighTechTalks DotNet Forums  

ATL ActiveX in C# User Control crashing designer

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss ATL ActiveX in C# User Control crashing designer in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
jhamers
 
Posts: n/a

Default ATL ActiveX in C# User Control crashing designer - 05-15-2007 , 02:23 AM






Hi,

I'm using a ATL ActiveX on a C# windows form (Visual studio 2005).
That works great. However, I wanted to create a C# user control which
would wrap this ActiveX. Therefore I created an empty user control and
just put this ActiveX on it. No problem so far.

However, when I wanted to test this dummy User Control, I put this
user control on its turn on a c# form.
That's when it started to go wrong. Once it is put on the form, I can
not move it anymore and when I click in the user control I get an
error saying that an unhandled exception caused the designer to crash.
In the activex there is a stack trace displayed:
...UnsafeNativeMethods.IOleInplace.UIDeactivate
at ...AxHost.UiDeactivate
at....AxHost.OnLostFocus...

I hooked up an instance of Visual studio 2003 to debug the Visual
studio 2005.
And it seems it is going wrong in the
::SetFocus call in SetControlFocus(TRUE) which is called from
CComControlBase::InPlaceActivate(LONG iVerb, const RECT* /
*prcPosRect*/) in atlctl.h

Anybody any ideas why an activex is making the designer go bananas
like this? And how to prevent it?

Kind Regards,
Jeroen


Reply With Quote
  #2  
Old   
Vitaly
 
Posts: n/a

Default Re: ATL ActiveX in C# User Control crashing designer - 05-17-2007 , 09:53 AM






Microsoft says that ActiveX can run in the thread with STA parameter (by
default a thread is started as MTA). Check your code in what thread type
you
start your activex.


"jhamers" <jhamers (AT) gmail (DOT) com> wrote

Quote:
Hi,

I'm using a ATL ActiveX on a C# windows form (Visual studio 2005).
That works great. However, I wanted to create a C# user control which
would wrap this ActiveX. Therefore I created an empty user control and
just put this ActiveX on it. No problem so far.

However, when I wanted to test this dummy User Control, I put this
user control on its turn on a c# form.
That's when it started to go wrong. Once it is put on the form, I can
not move it anymore and when I click in the user control I get an
error saying that an unhandled exception caused the designer to crash.
In the activex there is a stack trace displayed:
..UnsafeNativeMethods.IOleInplace.UIDeactivate
at ...AxHost.UiDeactivate
at....AxHost.OnLostFocus...

I hooked up an instance of Visual studio 2003 to debug the Visual
studio 2005.
And it seems it is going wrong in the
::SetFocus call in SetControlFocus(TRUE) which is called from
CComControlBase::InPlaceActivate(LONG iVerb, const RECT* /
*prcPosRect*/) in atlctl.h

Anybody any ideas why an activex is making the designer go bananas
like this? And how to prevent it?

Kind Regards,
Jeroen



I'm protected by SpamBrave
http://www.spambrave.com/




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.