Manifest Use for XP Style Controls 
Author Message
 Manifest Use for XP Style Controls

I've just added the manifest file to a project to get the new style
controls. I have:

Added an external manifest with the exe name plus ".manifest"

Added the following in my module's General Declarations:

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net



Fri, 09 Mar 2012 23:09:08 GMT  
 Manifest Use for XP Style Controls

Sorry. I thought I hit Ctrl-V to paste, but obviously hit something else.
:-(

I've just added the manifest file to a project to get the new style
controls. I have:

* Added an external manifest with the exe name plus ".manifest"

* Added the following in my module's General Declarations:

Public Type tagInitCommonControlsEx
   lngSize As Long
   lngICC As Long
End Type
Public Declare Function InitCommonControlsEx Lib "comctl32.dll" (iccex As
tagInitCommonControlsEx) As Boolean

* Added the following to Sub Main:

   On Error Resume Next
     ' this will fail if Comctl not available
   Dim iccex As tagInitCommonControlsEx
   With iccex
      .lngSize = LenB(iccex)
     .lngICC = ICC_USEREX_CLASSES
    End With
   InitCommonControlsEx iccex

After compiling, I get the new control appearance just fine, but:

* Instead of starting, loading and displaying a small data file in well
under 1 second, it now takes over 12 seconds.

* When /closing/ the program using the X, I get the Program has encountered
a problem and needs to close message. This does not happen when I click my
Close button, which has code that simply has Unload Me.

What am I forgetting to do?

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net



Fri, 09 Mar 2012 23:17:38 GMT  
 Manifest Use for XP Style Controls

I've found that in the minimal testing I've done with an external manifest
the code you have is redundant, the themes seems to work with just the file.
However if you shove the manifest into a resource file as Id =1 with the
container being "24" you do need that code.
You are certain this is where your problem lies, if you REM out the code do
you still get the problem, if you remove the manifest what transpires?

Regards
Dave O.


Quote:
> Sorry. I thought I hit Ctrl-V to paste, but obviously hit something else.
> :-(

> I've just added the manifest file to a project to get the new style
> controls. I have:

> * Added an external manifest with the exe name plus ".manifest"

> * Added the following in my module's General Declarations:

> Public Type tagInitCommonControlsEx
>   lngSize As Long
>   lngICC As Long
> End Type
> Public Declare Function InitCommonControlsEx Lib "comctl32.dll" (iccex As
> tagInitCommonControlsEx) As Boolean

> * Added the following to Sub Main:

>   On Error Resume Next
>     ' this will fail if Comctl not available
>   Dim iccex As tagInitCommonControlsEx
>   With iccex
>      .lngSize = LenB(iccex)
>     .lngICC = ICC_USEREX_CLASSES
>    End With
>   InitCommonControlsEx iccex

> After compiling, I get the new control appearance just fine, but:

> * Instead of starting, loading and displaying a small data file in well
> under 1 second, it now takes over 12 seconds.

> * When /closing/ the program using the X, I get the Program has
> encountered a problem and needs to close message. This does not happen
> when I click my Close button, which has code that simply has Unload Me.

> What am I forgetting to do?

> --
> Regards,

> Rick Raisley
> heavymetal-A-T-bellsouth-D-O-T-net



Fri, 09 Mar 2012 23:53:53 GMT  
 Manifest Use for XP Style Controls

Quote:
> I've found that in the minimal testing I've done with an external manifest
> the code you have is redundant, the themes seems to work with just the
> file.
> However if you shove the manifest into a resource file as Id =1 with the
> container being "24" you do need that code.
> You are certain this is where your problem lies, if you REM out the code
> do you still get the problem, if you remove the manifest what transpires?

If you embed a manifest, make sure it's multiple of 4 bytes. See this
article:

BUG: Visual Basic Compiler Pads Embedded Resources to Align on 32-Bit Dword
Boundaries
http://support.microsoft.com/kb/297112/en-us



Sat, 10 Mar 2012 00:06:47 GMT  
 Manifest Use for XP Style Controls
Leaving the code unchanged, if I rename the Manifest (so it's not used), the
program loads very quickly, and no error occurs when closing the program
using the X. And of course, it has no new control styles. Naming the
Manifest correctly, results in the delay during loading and the error on
closing. I'm thinking I missed something to properly enable the manifest,
but can't find it.

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net


Quote:
> I've found that in the minimal testing I've done with an external manifest
> the code you have is redundant, the themes seems to work with just the
> file.
> However if you shove the manifest into a resource file as Id =1 with the
> container being "24" you do need that code.
> You are certain this is where your problem lies, if you REM out the code
> do you still get the problem, if you remove the manifest what transpires?

> Regards
> Dave O.



>> Sorry. I thought I hit Ctrl-V to paste, but obviously hit something else.
>> :-(

>> I've just added the manifest file to a project to get the new style
>> controls. I have:

>> * Added an external manifest with the exe name plus ".manifest"

>> * Added the following in my module's General Declarations:

>> Public Type tagInitCommonControlsEx
>>   lngSize As Long
>>   lngICC As Long
>> End Type
>> Public Declare Function InitCommonControlsEx Lib "comctl32.dll" (iccex As
>> tagInitCommonControlsEx) As Boolean

>> * Added the following to Sub Main:

>>   On Error Resume Next
>>     ' this will fail if Comctl not available
>>   Dim iccex As tagInitCommonControlsEx
>>   With iccex
>>      .lngSize = LenB(iccex)
>>     .lngICC = ICC_USEREX_CLASSES
>>    End With
>>   InitCommonControlsEx iccex

>> After compiling, I get the new control appearance just fine, but:

>> * Instead of starting, loading and displaying a small data file in well
>> under 1 second, it now takes over 12 seconds.

>> * When /closing/ the program using the X, I get the Program has
>> encountered a problem and needs to close message. This does not happen
>> when I click my Close button, which has code that simply has Unload Me.

>> What am I forgetting to do?

>> --
>> Regards,

>> Rick Raisley
>> heavymetal-A-T-bellsouth-D-O-T-net



Sat, 10 Mar 2012 01:07:15 GMT  
 Manifest Use for XP Style Controls
Have you seen this? From vbAccelerator

"Some versions of ComCtl32.DLL version 6.0 cause a crash at shutdown
when you enable XP Visual Styles in an application. This particularly
occurs when using VB User Controls." No mention of speed penalties
though

Two fixes proposed: one is to preload Shell32 in the Initialize event
of the form containing the control. The other is, just use code to
turn off the unhandled exception error. More here

http://www.vbaccelerator.com/home/vb/code/libraries/XP_Visual_Styles/...

HTH mark



Sat, 10 Mar 2012 01:19:37 GMT  
 Manifest Use for XP Style Controls

Just got back to this project, and of course it still has the problem
(starts up in a minute instead of a second, and displays an error on
closing). Both occur only if the manifest file is in place. Other programs
using the same method, and code, work fine. This one doesn't.

This is using the same manifest file (but renamed - also tried one with the
program name changed within it, although I don't think that matters), and
the same code in Sub Main to initialize it. Works for the other programs,
but not this one.

Confusing, this is....

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net


Quote:
> Leaving the code unchanged, if I rename the Manifest (so it's not used),
> the program loads very quickly, and no error occurs when closing the
> program using the X. And of course, it has no new control styles. Naming
> the Manifest correctly, results in the delay during loading and the error
> on closing. I'm thinking I missed something to properly enable the
> manifest, but can't find it.

> --
> Regards,

> Rick Raisley
> heavymetal-A-T-bellsouth-D-O-T-net



>> I've found that in the minimal testing I've done with an external
>> manifest the code you have is redundant, the themes seems to work with
>> just the file.
>> However if you shove the manifest into a resource file as Id =1 with the
>> container being "24" you do need that code.
>> You are certain this is where your problem lies, if you REM out the code
>> do you still get the problem, if you remove the manifest what transpires?

>> Regards
>> Dave O.



>>> Sorry. I thought I hit Ctrl-V to paste, but obviously hit something
>>> else. :-(

>>> I've just added the manifest file to a project to get the new style
>>> controls. I have:

>>> * Added an external manifest with the exe name plus ".manifest"

>>> * Added the following in my module's General Declarations:

>>> Public Type tagInitCommonControlsEx
>>>   lngSize As Long
>>>   lngICC As Long
>>> End Type
>>> Public Declare Function InitCommonControlsEx Lib "comctl32.dll" (iccex
>>> As tagInitCommonControlsEx) As Boolean

>>> * Added the following to Sub Main:

>>>   On Error Resume Next
>>>     ' this will fail if Comctl not available
>>>   Dim iccex As tagInitCommonControlsEx
>>>   With iccex
>>>      .lngSize = LenB(iccex)
>>>     .lngICC = ICC_USEREX_CLASSES
>>>    End With
>>>   InitCommonControlsEx iccex

>>> After compiling, I get the new control appearance just fine, but:

>>> * Instead of starting, loading and displaying a small data file in well
>>> under 1 second, it now takes over 12 seconds.

>>> * When /closing/ the program using the X, I get the Program has
>>> encountered a problem and needs to close message. This does not happen
>>> when I click my Close button, which has code that simply has Unload Me.

>>> What am I forgetting to do?

>>> --
>>> Regards,

>>> Rick Raisley
>>> heavymetal-A-T-bellsouth-D-O-T-net



Mon, 30 Apr 2012 01:15:55 GMT  
 Manifest Use for XP Style Controls
Rick Raisley escribi:

Quote:
> Just got back to this project, and of course it still has the problem
> (starts up in a minute instead of a second,

I don't know. If nobody knows you'll need to isolate the cause.

Quote:
> and displays an error on
> closing). Both occur only if the manifest file is in place.
> Other programs
> using the same method, and code, work fine. This one doesn't.

> This is using the same manifest file (but renamed - also tried one with the
> program name changed within it, although I don't think that matters), and
> the same code in Sub Main to initialize it. Works for the other programs,
> but not this one.

> Confusing, this is....

Do you have an UserControl?

http://www.vbaccelerator.com/home/vb/Code/Libraries/XP_Visual_Styles/...



Mon, 30 Apr 2012 02:00:25 GMT  
 Manifest Use for XP Style Controls

Quote:

> Rick Raisley escribi:
>> Just got back to this project, and of course it still has the problem
>> (starts up in a minute instead of a second,

> I don't know. If nobody knows you'll need to isolate the cause.

>> and displays an error on closing). Both occur only if the manifest file
>> is in place.
>> Other programs using the same method, and code, work fine. This one
>> doesn't.

>> This is using the same manifest file (but renamed - also tried one with
>> the program name changed within it, although I don't think that matters),
>> and the same code in Sub Main to initialize it. Works for the other
>> programs, but not this one.

>> Confusing, this is....

> Do you have an UserControl?

> http://www.vbaccelerator.com/home/vb/Code/Libraries/XP_Visual_Styles/...

Nope, no user controls.

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net



Mon, 30 Apr 2012 02:20:32 GMT  
 Manifest Use for XP Style Controls

Quote:
>> Do you have an UserControl?

>> http://www.vbaccelerator.com/home/vb/Code/Libraries/XP_Visual_Styles/...

> Nope, no user controls.

Anyway, I would try doing what the article says.

PS: may be you have some trird party control that uses an UserControl?



Mon, 30 Apr 2012 05:23:23 GMT  
 Manifest Use for XP Style Controls

Quote:

>>> Do you have an UserControl?

>>> http://www.vbaccelerator.com/home/vb/Code/Libraries/XP_Visual_Styles/...

>> Nope, no user controls.

> Anyway, I would try doing what the article says.

> PS: may be you have some trird party control that uses an UserControl?

I'm not using any 3rd party controls at all, in fact no added controls at
all.

I did try the fix, and it did eliminate the crash message at shutdown, but
the delay on startup is still there. Without the manifest file, this tiny
(61kB) program starts instantly. With the manifest file (and with this code,
or not), it takes much, much longer to start, with the screen and hourglass
displayed. At this point, I'd prefer eliminating the new control style to
having the delay, but it's maddening when I have far more complex programs,
using the same code and manifest to display new control styles, and they
start quickly /and/ have no crash message.

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net



Mon, 30 Apr 2012 22:00:51 GMT  
 Manifest Use for XP Style Controls
Rick Raisley escribi:

Quote:

>>>> Do you have an UserControl?

>>>> http://www.vbaccelerator.com/home/vb/Code/Libraries/XP_Visual_Styles/...
>>> Nope, no user controls.
>> Anyway, I would try doing what the article says.

>> PS: may be you have some trird party control that uses an UserControl?

> I'm not using any 3rd party controls at all, in fact no added controls at
> all.

> I did try the fix, and it did eliminate the crash message at shutdown, but
> the delay on startup is still there. Without the manifest file, this tiny
> (61kB) program starts instantly. With the manifest file (and with this code,
> or not), it takes much, much longer to start, with the screen and hourglass
> displayed. At this point, I'd prefer eliminating the new control style to
> having the delay, but it's maddening when I have far more complex programs,
> using the same code and manifest to display new control styles, and they
> start quickly /and/ have no crash message.

Hi,

It would be very interesting if you could isolate the problem.
If the program is so small, it shouldn't be big deal.



Mon, 30 Apr 2012 22:22:33 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. Windows XP Style Manifest doesn't work on ActiveX Control Projects

2. XP Styles Manifest and Graphical Buttons

3. VB6-created frames problems with XP style manifests - vbappxp.jpg (0/1)

4. Using XP Visual Styles

5. Using Visual Styles in Windows XP

6. XP Manifest

7. Manifest Files on Windows XP - VB6

8. XP Manifest..

9. XP manifest file

10. XP Manifest

11. Controls and XP styles

12. Windows XP Styles : Tab Control Background

 

 
Powered by phpBB® Forum Software