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 2006

Tip: Looking for answers? Try searching our database.

Windowless ActiveX controls are not supported

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alfredo Delgadillo - 16 May 2006 21:07 GMT
Hi everybody,

I using VS.NET 2005 Pro to develop win form application and I need include
an activex control to show information, this works good In developing time
but after deploy doesn't work it, I try to running in a clean machine with
framework 2.0 installed

I found this error 'Unable to get the window handle for the 'AxMyActivex'
control. Windowless ActiveX controls are not supported.' when I tray to show
the form with actvex control.

Please, could you someone help me?.

Regards,
Alfredo
Christian Fröschlin - 17 May 2006 09:43 GMT
> I found this error 'Unable to get the window handle for the 'AxMyActivex'
> control. Windowless ActiveX controls are not supported.' when I tray to show
> the form with actvex control.

Wild shot, but the one time I encountered something like this
it was related to some enhanced virus protection feature of
the CPU (Data Execution Prevention / DEP), in which case it
could be prevented using NoExecute=AlwaysOff in boot.ini.

http://support.microsoft.com/kb/875352
Alfredo Delgadillo - 17 May 2006 15:22 GMT
This solution doesn't work for me, this error continues being shown.

I try this options:

1) I set Data Execution Prevention in Advanced properties of my machine to
second option 'Turn on DEP fo all programs and services except I select', and
I add my application, it doesn't work.

2) I was modified boot.ini file changing /noexecute value from
/noexecute=optin to /noexecute=AllwaysOff, it doesn't work too.

do you have any other recomendation?

> Wild shot, but the one time I encountered something like this
> it was related to some enhanced virus protection feature of
> the CPU (Data Execution Prevention / DEP), in which case it
> could be prevented using NoExecute=AlwaysOff in boot.ini.
>
> http://support.microsoft.com/kb/875352
The Real Andy - 18 May 2006 10:17 GMT
>Hi everybody,
>
[quoted text clipped - 11 lines]
>Regards,
>Alfredo

I reckon you might be having some threading issues. Try putting all
your calls in a try catch block and see if you get any exceptions.
Alfredo Delgadillo - 18 May 2006 13:36 GMT
Hi Andy, this the error detail

    |--->Error Type: InvalidOperationException
    |--->Rutine: EnsureWindowPresent
    |--->Description: Unable to get the window handle for the
'AxctrProject' control. Windowless ActiveX controls are not supported.

Stack Trace:
  at System.Windows.Forms.AxHost.EnsureWindowPresent()
  at System.Windows.Forms.AxHost.InPlaceActivate()
  at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
  at System.Windows.Forms.AxHost.CreateHandle()
  at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
  at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
  at System.Windows.Forms.AxHost.EndInit()
  at Name.Detail.TS20.frmForm1.InitializeComponent()
  at Name.Detail.TS20.frmForm1..ctor(Boolean blnAll)
  at Name.Detail.TS20.frmMain.ExecuteAction(String key, Boolean blnExe)

Each block has a try and cach exception.

> I reckon you might be having some threading issues. Try putting all
> your calls in a try catch block and see if you get any exceptions.
The Real Andy - 19 May 2006 09:46 GMT
>Hi Andy, this the error detail
>
[quoted text clipped - 16 lines]
>
>Each block has a try and cach exception.

Without seeing the code, its hard to know what you are doing.

You need to remmeber that the active x control will run on a seperate
thread, and to allow access to the winform thread you need to provide
some kind of thread safe access, typically through invoke.

CAn you get access to VS2003? I beleive the cross threading stuff was
less strictly enforced in 2003.
Willy Denoyette [MVP] - 19 May 2006 14:57 GMT
| >Hi Andy, this the error detail
| >
[quoted text clipped - 22 lines]
| thread, and to allow access to the winform thread you need to provide
| some kind of thread safe access, typically through invoke.

Hold on, ActiveX controls must be marked as ThreadingModel= Apartment in the
registry, that is they must run in a STA, assumed that the Form runs in an
STA, the Control also runs in the same STA (same thread).
To the OP, check your controls' apartment requirements.

Willy.

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.