|
| .Net Framework 1.1 toolbandband in IE on XP, problem implementing Visual Styles |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.framework.interop.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| jwallison |
I have implemented an IE toolband object in C#/Framework 1.1. All is well, except if I want to try to enable visual styles in the toolband.
If I call Application.EnableVisualStyles()/Application.DoEvents(), I get a beautiful, visual styles-type interface displayed by my toolband... until IE exits, at which time, I get:
Unhandled exception at 0x77f6fafb (ntdll.dll) in iexplore.exe: 0xC015000F: The activation context being deactivated is not the most recently activated one.
I'm guessing that the side-by-side assembly stuff in XP is getting bollixed at his point, that the "most recently activated one" (activation context) in the exception message refers to my .Net component, and the one being deactited (improperly0 is associated w. IE.
I know that the docs say that EnableVisualStyles() should be made "before any controls are instantiated by the application", but this is a COM DLL loaded in the context of IE - if calling EnableVisualStyles in the context of an in-place COM component isn't valid, maybe EnableVisualStyles() should throw an exception under these circumstances?
Anyway, anybody know a workaround?
-- Regards,
Jim Allison Click here to reveal e-mail address (de-mung by removing '.1')
|
|
|
| |
|
| |
| |
| Bina Shukla[MS] (VIP) |
Hi Jim,
We are currently investigating on this issue and will post our results here as soon as we can.
Regards, Bina Shukla
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
| |
|
|
| |
| |
| Bina Shukla[MS] (VIP) |
Hi Jim,
We are currently investigating on this issue and will post our results here as soon as we can.
Regards, Bina Shukla
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
| |
|
|
| |
| | |
| |
| Bina Shukla[MS] (VIP) |
Hi Jim,
I've found that just calling Application.EnableVIsualStyles in your toolband code does not enable xp theming. XP theming is enabled only when Application.DoEvents is called after Application.EnableVisualStyles. In this scenario, the activation context is deactivated as soon as it is activated. I've notified the product team regarding this problematic behavior.
Instead of using Application.EnableVisualStyles you can use the Activation context APIs directly to enable theming for your toolband.
Regards, Bina Shukla
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
| |
|
|
| |
| |
| jwallison |
Bina -
See the following search on Google regarding the use of DoEvents() after calling Application.EnableVisualStyles():
http://www.google.com/groups?as_q=EnableVisualStyles%20DoEvents&safe=images&ie=UTF-8&oe=UTF-8&as_ugroup=microsoft.public.dotnet.framework.*&lr=&num=100&hl=en
There are a number of MS MVPs who recommend the use of DoEvents() after Application.EnableVisualStyles() to alleviate a "minor flaw" in how Application.DoEvents() functions. It appears that maybe there is some sort of logic related to (WM_CHANGEUISTATE/WM_UPDATEUISTATE ?) that must be processed (which means that messages must be pumped - in this case, by calling DoEvents()) in order for Application.EnableVisualStyles() to function correctly in some circumstances..
- If the activation context is immediately deactivated under this scenario, I suppose it is reasonable to assume that the deactivation you refer to occurs when returning to IE's context from the BandObject DLL (i.e. - of course it does).
- You say that the application context is immediately deactivated. Since the purpose of the activation context API is to allow apps or components to use a particular version of a DLL or DLLs, and .Net uses COMCTL32.DLL v5 before Application.EnableVisualStyles(), and commences to use COMCTL32.DLL v6 throughout the life of the IE session (as evidenced by the themed appearance of the controls in the toolband), how could the context activated by Application.EnableVisualStyles() NOT be active on every call to the BandObject throughout its lifetime? Is the context not reactivated upon later reentry to the BandObject?
In summary:
1) The application context API works as-designed, deactivating when the context of a loaded DLL is exited. Not much help here. 2) Application.EnableVisualStyles() is slightly flawed, but there is a workaround. Agaiun, nothing I didn't know. 2) .Net developers are welcome to use the Win32 APIs instead of using the context management functionality in the .Net Framework, not because there is a bug in the Framework or IE, but "because they can" (?)
What is the source of the following error when IE exits? .Net, or IE?
Unhandled exception at 0x77f6fafb (ntdll.dll) in iexplore.exe: 0xC015000F: The activation context being deactivated is not the most recently activated one.
If Application.EnableVisualStyles() doesn't mean true context-awareness for components, then, fine - say so (someplace in MSDN). If it SHOULD, but it doesn't, then it's a bug, and should be entered as such. If it doesn't work in IE for some IE-specific reason, also fine (repeat after me... "not by design", bnut at least say, "IE does not support this.)
Any of the above three options are reasonable...
-- Regards,
Jim Allison Click here to reveal e-mail address (de-mung by removing '.1')
"Bina Shukla[MS]" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address... [Original message clipped]
|
|
|
| |
|
|
| |
|
|
|
|
| |
| Ying-Shen Yu[MSFT] (VIP) |
Hi Jim,
Does this problem only occur when you enable Visual Style on your Bind Object?
The problem seems a bit complex, It needs some further investigation, I'm not sure if we can deal with it in the newsgroup. Perhaps it's better to contact Product Support Service, there will be a suport engineer dedicated to help you on this problem.
Anyway, I'd would like to get a simple repro sample to see look into it and see if I can find a work around to this problem. Thanks!
Best regards,
Ying-Shen Yu [MSFT] Microsoft Online Partner Support Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights. You should not reply this mail directly, "Online" should be removed before sending.
|
|
|
| |
|
|
| |
| |
| jwallison |
Yes, it works fine until IE exits after EnableVisualStyles() has been called in the toolband. ("All is well, EXCEPT...")
The component (and IE) terminate normally if EnableVisualStyles() is not called in the toolband constructor. The only anomaly I have noted is the problem regarding the exception thrown by IE when it is closed.
A good start to an answer for this would be whether or not calling EnableVisualStyles() (in the constructor, prior to InitializeComponents()) in a COM DLL component loaded in the context of a non-.Net app is valid. This isn't a matter for "repro", it is a question of whether or not it SHOULD work, "by design".
The seconds question would be, if it SHOULD work "by design", is there an issue with my code, or IE itself, that prevents the proper functioning of the component (IE throwing an exception at exit, obviously because this component has been running within its context).
I'd like to get an answer to the first before tackling the second. Only Microsoft has "the answer", but maybe someone in the developer community has a solution or a workaround (they've gotten Visual Styles to work in a band object)?
-- Regards,
Jim Allison Click here to reveal e-mail address (de-mung by removing '.1')
""Ying-Shen Yu[MSFT]"" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address... [Original message clipped]
|
|
|
| |
|
| |
| |
| John Eikanger (VIP) |
Hi, Jim
I understand where you are coming from, but it is very difficult to get this sort of question addressed without a demonstrable problem to hang the question onto. The usual flow is reproducible problem is submitted, and issue eventually gets escalated to someone who can state authoritatively that the problem is a bug or by design. Either resolution begs the question of what can be done to make the sample work, and most often a workable answer is forthcoming. Not always, since some things are too nasty to fix except in a full product release.
Bottom line: I need a small sample that reproduces the problem before I can take this any further. Please encapsulate the sample in a Zip and send it to me, since Exchange will strip out individual files if it doesn't like the extension.
If you don't still have my email on file, just remove "online." from my no-spam alias.
Thank you for choosing the MSDN Managed Newsgroups,
John Eikanger Microsoft Developer Support
This posting is provided “AS IS” with no warranties, and confers no rights. -------------------- | From: "jwallison" <Click here to reveal e-mail address> | Subject: Re: .Net Framework 1.1 toolbandband in IE on XP, problem implementing Visual Styles | X-Tomcat-NG: microsoft.public.dotnet.framework.interop | | Yes, it works fine until IE exits after EnableVisualStyles() has been called | in the toolband. ("All is well, EXCEPT...") | | The component (and IE) terminate normally if EnableVisualStyles() is not | called in the toolband constructor. The only anomaly I have noted is the | problem regarding the exception thrown by IE when it is closed. | | A good start to an answer for this would be whether or not calling | EnableVisualStyles() (in the constructor, prior to InitializeComponents()) | in a COM DLL component loaded in the context of a non-.Net app is valid. | This isn't a matter for "repro", it is a question of whether or not it | SHOULD work, "by design". | | The seconds question would be, if it SHOULD work "by design", is there an | issue with my code, or IE itself, that prevents the proper functioning of | the component (IE throwing an exception at exit, obviously because this | component has been running within its context). | | I'd like to get an answer to the first before tackling the second. Only | Microsoft has "the answer", but maybe someone in the developer community has | a solution or a workaround (they've gotten Visual Styles to work in a band | object)? | | -- | Regards, | | Jim Allison | Click here to reveal e-mail address | (de-mung by removing '.1') | | | | | ""Ying-Shen Yu[MSFT]"" <Click here to reveal e-mail address> wrote in message | news:Click here to reveal e-mail address... | > Hi Jim, | > | > Does this problem only occur when you enable Visual Style on your Bind | > Object? | > | > The problem seems a bit complex, It needs some further investigation, I'm | > not sure if we can deal with it in the newsgroup. Perhaps it's better to | > contact Product Support Service, there will be a suport engineer dedicated | > to help you on this problem. | > | > Anyway, I'd would like to get a simple repro sample to see look into it | and | > see if I can find a work around to this problem. | > Thanks! | > | > Best regards, | > | > Ying-Shen Yu [MSFT] | > Microsoft Online Partner Support | > Get Secure! - www.microsoft.com/security | > | > This posting is provided "AS IS" with no warranties and confers no rights. | > You should not reply this mail directly, "Online" should be removed before | > sending. | > | | |
|
|
|
| |
|
|
| |
| |
| jwallison |
John -
Sorry I didn't respond sooner, but I was frantically testing the toolband for release (12/5) - I didn't have time to go through "stripping out" the serialization classes, threading, etc. in order to provide a "simple" repro (if there IS such a thing for a band object).
This was one of those classic "the customer wanted xyz at the last moment" items, so it was faster to wrap some of the uxtheme API stuff w. PInvoke than hack the living daylights out of the code and pray for a (timely and positive)response.
The Platform SDK docs indicate component-level activation contexts are possible, and, in fact, desirable:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sbscs/setup/isolating_components.asp
So, management of activation contexts and use of side-by-side assemblies is possible in unmanaged code. In this specific case, it appears that activation context behavior is "odd", because one would think the .Net bandobject being loaded into IE would inherit the activation context from IE, i.e. - if IE is thunking COMCTL32 v6, that the bandobject would ALSO refernce COMCTL32 v6. Maybe the .Net component IS behaving per the link above, and using the "default" behavior for .Net - use of COMCTL32 v5?
It sure would be simpler and a LOT more forthcoming to answer the question:
[Original message clipped]
- than to go down the "empirical-proof" path ("this is how it works; therefore, the behavior is by-design"). Because what SHOULD work in App "A" might NOT work in App "B", even though the behavior in "A" is the behavior that MS intended.
I've got a little time to breathe now, so I'll work on the repro.
Regards,
Jim Allison mailto:Click here to reveal e-mail address http://www.home.bellsouth.net/personalpages/pwp-jallison/
""John Eikanger"" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address... [Original message clipped]
|
|
|
| |
|
| |
| |
| dirk lx |
(Type your message here)
-------------------------------- From: Dirk Liebich,
I'm just curious if you guys ever figured out what the solution is. If so would you be so kind to post it here as I face the same issue.
Funny enough in my case it happened all of the sudden. It work for weeks and then bum! I have no clue what I did.
Thanks for your help in advance.
Dirk
Click here to reveal e-mail address
please strip XXXX_
|
|
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|