Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / May 2007

Tip: Looking for answers? Try searching our database.

ATL ActiveX in C# User Control crashing designer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jhamers - 15 May 2007 07:23 GMT
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
Vitaly - 17 May 2007 14:00 GMT
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.

> Hi,
>
[quoted text clipped - 25 lines]
> Kind Regards,
> Jeroen

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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.