comp.lang.ada
 help / color / mirror / Atom feed
* GNAT and Windows XP Manifest
@ 2009-07-10  9:41 Hibou57 (Yannick Duchêne)
  2009-07-10 10:14 ` Hibou57 (Yannick Duchêne)
  0 siblings, 1 reply; 5+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2009-07-10  9:41 UTC (permalink / raw)


A little summary to start with : the Windows common controls comes in
two flavors with Windows XP. There is the old one, which is the
default and give the GUI a Windows 98 style. This is the version 5.8.
Beside, there is also the version 6, which gives the well known
Windows XP style to the GUI. As the default is the version 5.8,
something is to be done for each applications to give it the Windows
XP style : tell Windows to use Common Controls version 6 instead of
the default version 5.8

This is done using what is named an Assembly Manifest, which can be an
XML file in the application's directory, or which can be included in
the application's resources.

It seems that GNAT has some troubles with these assembly Manifest. As
exemple, if the application makes reference to a manifest, either as
an XML file or as a resource, any message box opened, will close
immediatly (nothing is displayed, just the message box sound can be
heard) without waiting for the user to select any button, returning 0,
meaning an error, while GetLastError return 0, meaning no error.

This happens even if as an exemple, a message box is opened before
invokation to “ adainit ”, which first maked me think there was a
trouble in he way the application is linked.

This is not a trouble with the library files used to link to Windows
DLLs, beceause these are the same as the ones GCC use, and a C
application compiled with GCC, using the same DLL import libraries,
does not fail.

So perhaps it is a matter of the way the application is built ?

It happens even if the application does not use an external main
program, so it is nor a trouble with this external main program.

This is very strange, I have no idea of what's involved here.

If GetLastError, which is testes right after the call to MessageBoxA
would returns any error information, this would help, but this just
returns 0.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GNAT and Windows XP Manifest
  2009-07-10  9:41 GNAT and Windows XP Manifest Hibou57 (Yannick Duchêne)
@ 2009-07-10 10:14 ` Hibou57 (Yannick Duchêne)
  2009-07-10 10:57   ` Hibou57 (Yannick Duchêne)
  0 siblings, 1 reply; 5+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2009-07-10 10:14 UTC (permalink / raw)


> It happens even if the application does not use an external main
> program, so it is nor a trouble with this external main program.

Erratum: for this one, it happens only when the binder is given the “ -
n ”. This occurs with external main programs

But in the mean time, I've found one of my old application which was
compiled under Windows 98, without the option “ -n ” for the binder,
which use an Ada main program, and whose message boxes all failed when
a manifest is given in its directory. Other windows opens normally
(none of its other windows comes from common contols, except message
boxes).



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GNAT and Windows XP Manifest
  2009-07-10 10:14 ` Hibou57 (Yannick Duchêne)
@ 2009-07-10 10:57   ` Hibou57 (Yannick Duchêne)
  2009-07-10 19:37     ` Gautier write-only
  0 siblings, 1 reply; 5+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2009-07-10 10:57 UTC (permalink / raw)


Solved.

Explanation: althought message boxes does not belongs to the
ComCtl32.dll shared library, it is mandatory to invok
InitCommonControls.

Platform DSK documentation says:
> To create a manifest and enable your application to use
> visual styles.
>
> Link to ComCtl32.lib and call InitCommonControls.
> Add a file called YourApp.exe.manifest to your source tree that
> has the XML manifest format.

If InitCommonControls is invoked during application initialization,
the manifest is handled correctly.

Perhaps that with common controls version 6, the message box is now
part of the ComCtl32.dll library (this is the sole reason I can
imagine).

This is thus not specific to GNAT, but would be the same with any
others, like Janus, etc.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GNAT and Windows XP Manifest
  2009-07-10 10:57   ` Hibou57 (Yannick Duchêne)
@ 2009-07-10 19:37     ` Gautier write-only
  2009-07-10 21:12       ` Hibou57 (Yannick Duchêne)
  0 siblings, 1 reply; 5+ messages in thread
From: Gautier write-only @ 2009-07-10 19:37 UTC (permalink / raw)


On 10 juil, 12:57, Hibou57 (Yannick Duchêne)
<yannick_duch...@yahoo.fr> wrote:
> Solved.
>
> Explanation: althought message boxes does not belongs to the
> ComCtl32.dll shared library, it is mandatory to invok
> InitCommonControls.
>
> Platform DSK documentation says:
>
> > To create a manifest and enable your application to use
> > visual styles.
>
> > Link to ComCtl32.lib and call InitCommonControls.
> > Add a file called YourApp.exe.manifest to your source tree that
> > has the XML manifest format.
>
> If InitCommonControls is invoked during application initialization,
> the manifest is handled correctly.
>
> Perhaps that with common controls version 6, the message box is now
> part of the ComCtl32.dll library (this is the sole reason I can
> imagine).
>
> This is thus not specific to GNAT, but would be the same with any
> others, like Janus, etc.

Thanks for the info, I was just wondering how to make some GWindows
applications use these "new" visual styles.
_________________________________________________________
Gautier's Ada programming -- http://sf.net/users/gdemont/
NB: For a direct answer, e-mail address on the Web site!



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GNAT and Windows XP Manifest
  2009-07-10 19:37     ` Gautier write-only
@ 2009-07-10 21:12       ` Hibou57 (Yannick Duchêne)
  0 siblings, 0 replies; 5+ messages in thread
From: Hibou57 (Yannick Duchêne) @ 2009-07-10 21:12 UTC (permalink / raw)


On 10 juil, 21:37, Gautier write-only <gautier_niou...@hotmail.com>
wrote:

> Thanks for the info, I was just wondering how to make some GWindows
> applications use these "new" visual styles.
> _________________________________________________________
> Gautier's Ada programming --http://sf.net/users/gdemont/
> NB: For a direct answer, e-mail address on the Web site!

You're welcome :)

I've just made available as download, a little archive which contains
the necessary files:
http://www.les-ziboux.rasama.org/download/ada-windows-xp-style.zip

Have a nice time



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-07-10 21:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-10  9:41 GNAT and Windows XP Manifest Hibou57 (Yannick Duchêne)
2009-07-10 10:14 ` Hibou57 (Yannick Duchêne)
2009-07-10 10:57   ` Hibou57 (Yannick Duchêne)
2009-07-10 19:37     ` Gautier write-only
2009-07-10 21:12       ` Hibou57 (Yannick Duchêne)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox