Archive for the 'Windows' Category

April 13th 2007

C# + DWM -> pretty!

I was reading a nice, if slightly dated, set of articles about the new features in Windows Vista, including ars technica‘s rundown. This article mentions that not much of the functionality avaliable in the Desktop Window Manager (Aero to everyone else) is going to be exposed to third parties, which I think it a great shame.

However, quick investigation reveals that, at least, the thumbnaling stuff has an API.

B#’s blog shows how to get at the DWM previews in .NET, and the MSDN magazine shows how to create pure glass windows.

A quick combination (and about an hour trying to work out a decent layout algorithm) gives:

I’ve actually put a FDWMlist.net binary (sig) up, for once, even though it’s generally worse than the code I normally hide. :)

Any key to refresh. Any use may invalidate your Reliability Index. You have been warned.

No Comments yet »

April 12th 2007

Updates: Dell’s 2407WFP, Vista.

Before I mentioned that my 2407 was getting terrible artifacts.

So…

It turns out they go away if you plug it into the other port on my graphics card.

Doh.

Also, I mentioned that I was using mostly Microsoft apps on Vista. Some changes:

  • Windows Media Player has been sacrificed for Foobar2000 for music, after it “removed” most of the id3 tags from my mp3 files.
    Nitpickers’ Corner: Technically, it didn’t remove the tags at all.

    • Windows Media Player (and Windows Explorer) (and, for other things, pretty much the entirety of Windows) likes things in UTF-16. Most of the files in my collection have both id3v2.3 and id3v2.4 tags.
    • The 2.4 version of the tags, having been written by Picard (which, by default, writes UTF-8 tags (which I’d have probably picked anyway)), were not acceptable to WMP.
    • In this situation, WMP reads the 2.3 version of the tags (which has some nasty limitations like, for instance, cutting off all fields at a certain length), and writes a second id3v2.4 block to the files, at the start.
    • Next time anything attempts to read the file, it’ll see WMP’s 2.4 block (containing just the 2.3 information), skip over the real 2.4 block, and see the original 2.3 block, making it look like the tags have gone, whereas they’re actually still in the file.
  • WMP is still in use for video playing, but most of it’s decoding is now assisted by ffmpeg, which is awesome.
  • IE7 has now disappeared for Opera. Yaaaay, Opera.

1 Comment »

March 23rd 2007

Vista!

Yay, Vista arrived, thanks to Microsoft for running the developer “competition”, and thanks to Ian Moulster for keeping us posted.

Everything worked fine, even automatically grabbing the drivers for my (unflashed) SI3114 card up off Windows Update, and telling me to install the drivers for my X-fi.

So far, I’ve only had one major problem: The GUI is slow. Far too slow.

I expect that some of the slowness is actually being caused by Windows itself, but the one-second-plus black screen whilst switching to the secure desktop for UAC sounds incredibly unlikely. I’ve not worked out what to blame for this yet, but the nvidia drivers and the creative drivers are high up the list of possible candidates.

For reference, I currently have a Windows Experience index of 4.2 (RAM and CPU limited), and have tried disabling Aero and desktop composition, updating graphics drivers, etc.

I find it strange that, despite getting a 5.9 Experience index for “Graphics” (ie. desktop), the Vista required specs, quotes some rather vague definitions for “adequate graphics memory”, which makes no suggestions as to what would be recommended for ~4MP (3520×1200). Some event log messages suggest I’m running out at 256MB, which is bad. :/

Other minor things (note that, bar Miranda, Daemon Tools and BOINC I’ve been sticking to mostly Microsoft apps (yes, even IE7 and Windows Media Player)):

  • The “official” OpenSSL binaries use an old version of MSVCR71.dll, which I didn’t feel like installing (I’m sure I’ll pick it up when I install some crap later), building them is easy:
    perl Configure --openssldir=c:/openssl VC-WIN32
    ms\do_masm
    nmake -f ms\ntdll.mak
    nmake -f ms\ntdll.mak test
    nmake -f ms\ntdll.mak install
  • Textpad 4 (I didn’t get along with 5) needs to be run as Administrator to add itself to right-click menus.
  • You can no-longer set a PNG as your wallpaper?!
  • It’d be nice if there was some official support for XVid and Ogg/Vorbis (and maybe some other free (as in, to implement(ish)) standards, the second doesn’t even have an unofficial solution for WMP/Vista.
  • Aero picks up the artefacts in my tft quite spectacularily, damn.
  • And, most importantly, I suck at pre-format backups. :(

1 Comment »

March 1st 2007

cl /out:filename.exe

I was minorly confused today as to why all of my lovely compiled programs were disappearing and, instead, I was left with some empty files called ut.

For example, a test C++ file:
echo int main(){} > empty.cpp

Compile it:
>cl empty.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86

Copyright (C) Microsoft Corporation. All rights reserved.

empty.cpp
Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.

/out:empty.exe
empty.obj

As it clearly says, this /out:puts to “empty.exe”. Okay, I don’t want it to output to “empty.exe”, I want it to be called “full.exe”. So, I add /out:full.exe to my build script (along with all the normal junk like /MD and /nologo), and the output is now:

C:\Desktop>cl /nologo empty.cpp /out:full.exe
cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
empty.cpp

Curious, but only a warning, let’s ignore it.

..and full.exe doesn’t exist. Neither does empty.exe. There’s just this empty, zero-byte (according to Explorer) file called “ut”.

What’s happening, and what’s not immediately obvious if you don’t read boring warnings, is that the compiler it outputting (/ofilename to write the output to filename) to “ut:wrong.exe”, which is the NTFS alternate data stream called “wrong.exe”. Woops.

For reference, the message comes from the linker, not the compiler, which does use /out:filename, and the non-deprecated version of /o for the compiler is /Fefilename. Much clearer and easier to remember. Not.

3 Comments »

January 19th 2007

Belkin’s USB Wireless Adapter G: f5d7050uk

Dear Belkin, choice makes humans sad.

Which f5d7050 do I have? No idea.

As usual, the device has a huge STOP: Run the Installation CD-ROM FIRST. Inserting the CD and clicking “install” gets me:

---------------------------
Belkin Wireless USB Utility
---------------------------
Click on icon if you want to communicate directly to another wireless computer near you (Ad-Hoc).
---------------------------
OK
---------------------------

…and then disappears.

I decided, at random, to download the latest version of the drivers for Windows XP, ie. f5d7050-ver4.exe, a tiny 28MB, which do exactly the same as the CD.

A WinRAR extract of the download (eventually) yields a folder called Driver containing the necessary Windows driver files for 98 thru XP. Total compressed size of the necessary parts of the Driver folder that are needed for XP? 120kB. I don’t even want to know what craplets were bundled along with the driver.

Result: A working wireless network card having completely ignored all of the warnings from the packaging, setup, installer, manual, etc. and only the final step, installing the (non-WHQL’d) driver, as Administrator.

And people wonder why it’s the technically inept that have all the problems with their OSes

1 Comment »

January 10th 2007

Adobe GIL and <windows.h>

I’ve been playing with Adobe GIL, following it’s inclusion into Boost, and I’ve been getting some fun compile errors in relation to <windows.h>. Note that, even if you aren’t including <windows.h>, some of the boost headers do.

Here lies: What not to do, so you don’t waste hours on it like I did.

Test-case:
int main()
{
::gil::rgb8_image_t a;
::gil::jpeg_read_and_convert_image("a", a);
}

Compiled with Visual Studio 2005 SP1, Boost 1.33.1 and JPEG 6b (27-Mar-1998):

cl /EHsc jpegio.cpp /I c:\sdk\libs /I c:\boost\include\boost-1_33_1

First attempt, <windows.h> first:

#include <windows.h>

#include <gil/core/gil_all.hpp>
#include <gil/extension/io/jpeg_dynamic_io.hpp>

Error:

jpegio.cpp
c:\sdk\libs\gil\core\channel.hpp(90) : warning C4003: not enough actual paramete rs for macro 'min'
c:\sdk\libs\gil\core\channel.hpp(92) : warning C4003: not enough actual paramete rs for macro 'max'
c:\sdk\libs\jmorecfg.h(161) : error C2371: 'INT32' : redefinition; different bas ic types
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\basetsd.h(62) : see declaration of 'INT32'
c:\sdk\libs\jmorecfg.h(215) : warning C4005: 'FAR' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h(145) : see previous definition of 'FAR'

Second attempt, other way around, Error:
jpegio.cpp
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\basetsd.h(62): error C2371: 'INT32' : redefinition; different basic types
c:\sdk\libs\jmorecfg.h(161) : see declaration of 'INT32'

Third attempt:

#include <windows.h>
#include <gil/core/gil_all.hpp>

#define XMD_H
#include <gil/extension/io/jpeg_dynamic_io.hpp>
#undef XMD_H

This should, in theory improve matters, as XMD_H being #defined stops <jmorecfg.h> trying to redeclare INT32.

Oh no.

Error:

jpegio.cpp
c:\sdk\libs\gil\core\channel.hpp(90) : warning C4003: not enough actual parameters for macro 'min'
c:\sdk\libs\gil\core\channel.hpp(92) : warning C4003: not enough actual parameters for macro 'max'
c:\sdk\libs\jmorecfg.h(215) : warning C4005: 'FAR' : macro redefinition
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h(145) : see previous definition of 'FAR'
c:\sdk\libs\gil\core\color_convert.hpp(148) : error C2589: '(' : illegal token on right side of '::'
c:\sdk\libs\gil\core\color_convert.hpp(221) : see reference to function template instantiation 'void gil::color_converter_default_impl<lt;T1,C1,T2,C2>::operator ()<lt;SrcP,DstP>(const P1 &,P2 &) const' being compiled
with
[
T1=SrcChannel,
C1=SrcColorSpace,
T2=DstChannel,
C2=DstColorSpace,
SrcP=gil::pixel<lt;gil::bits8,gil::cmyk_t>,
DstP=gil::pixel<lt;gil::bits8,gil::rgb_t>,
P1=gil::pixel<lt;gil::bits8,gil::cmyk_t>,
P2=gil::pixel<lt;gil::bits8,gil::rgb_t>
]
c:\sdk\libs\gil\extension\dynamic_image\../../core/image_view_factory.hpp(71) : see reference to function template instantiation 'void gil::default_color_converter::operator ()<lt;gil::pixel<lt;T,C>,gil::pixel<lt;T,gil::rgb_t>>(const SrcP &,DstP &) const' being compiled
with
[
T=gil::bits8,
C=gil::cmyk_t,
SrcP=gil::pixel<lt;gil::bits8,gil::cmyk_t>,
DstP=gil::pixel<lt;gil::bits8,gil::rgb_t>
]
c:\sdk\libs\gil\extension\dynamic_image\../../core/image_view_factory.hpp(69) : while compiling class template member function 'gil::pixel<lt;T,C> gil::color_convert_deref_fn<lt;SrcConstRefP,DstP,CC>::operator ()(gil::pixel<lt;T,gil::cmyk_t> &) const'
with
[
T=gil::bits8,
C=gil::rgb_t,
SrcConstRefP=gil::cmyk8_ref_t,
DstP=gil::pixel<lt;gil::bits8,gil::rgb_t>,
CC=gil::default_color_converter
]
c:\sdk\libs\gil\extension\io\jpeg_io_private.hpp(166) : see reference to class template instantiation 'gil::color_convert_deref_fn<lt;SrcConstRefP,DstP,CC>' being compiled
with
[
SrcConstRefP=gil::cmyk8_ref_t,
DstP=gil::pixel<lt;gil::bits8,gil::rgb_t>,
CC=gil::default_color_converter
]
c:\sdk\libs\gil\extension\io\jpeg_io_private.hpp(178) : see reference to function template instantiation 'void gil::detail::jpeg_reader_color_convert<lt;CC>::apply<lt;V2>(const View &)' being compiled
with
[
CC=gil::default_color_converter,
V2=gil::rgb8_view_t,
View=gil::rgb8_view_t
]
c:\sdk\libs\gil\extension\io\jpeg_io.hpp(147) : see reference to function template instantiation 'void gil::detail::jpeg_reader_color_convert<lt;CC>::read_image<lt;Image>(Image &)' being compiled
with
[
CC=gil::default_color_converter,
Image=gil::rgb8_image_t
]
jpegio.cpp(12) : see reference to function template instantiation 'void gil::jpeg_read_and_convert_image<lt;gil::rgb8_image_t>(const char *,Image &)' being compiled
with
[
Image=gil::rgb8_image_t
]
c:\sdk\libs\gil\core\color_convert.hpp(148) : error C2143: syntax error : missing ')' before '::'
c:\sdk\libs\gil\core\color_convert.hpp(148) : error C2780: 'T gil::channel_invert(T)' : expects 1 arguments - 0 provided
c:\sdk\libs\gil\core\channel.hpp(235) : see declaration of 'gil::channel_invert'
c:\sdk\libs\gil\core\color_convert.hpp(148) : error C2059: syntax error : ')'
c:\sdk\libs\gil\core\color_convert.hpp(149) : error C2589: '(' : illegal token on right side of '::'
c:\sdk\libs\gil\core\color_convert.hpp(149) : error C2143: syntax error : missing ')' before '::'
c:\sdk\libs\gil\core\color_convert.hpp(149) : error C2780: 'T gil::channel_invert(T)' : expects 1 arguments - 0 provided
c:\sdk\libs\gil\core\channel.hpp(235) : see declaration of 'gil::channel_invert'
c:\sdk\libs\gil\core\color_convert.hpp(149) : error C2059: syntax error : ')'
c:\sdk\libs\gil\core\color_convert.hpp(150) : error C2589: '(' : illegal token on right side of '::'
c:\sdk\libs\gil\core\color_convert.hpp(150) : error C2143: syntax error : missing ')' before '::'
c:\sdk\libs\gil\core\color_convert.hpp(150) : error C2780: 'T gil::channel_invert(T)' : expects 1 arguments - 0 provided
c:\sdk\libs\gil\core\channel.hpp(235) : see declaration of 'gil::channel_invert'
c:\sdk\libs\gil\core\color_convert.hpp(150) : error C2059: syntax error : ')'

Fourth attempt, the “right” way:

#include <gil/core/gil_all.hpp>

#define XMD_H
#include <gil/extension/io/jpeg_dynamic_io.hpp>
#undef XMD_H

#include <windows.h>

This works as intended.

Solutions?

Assuming that we’re not going to get the JPEG code patched, the INT32 definition from <windows.h> comes from <basetsd.h>, which declares the BASETSD_H header-guard macro.. it’d be nice if GIL issued an explanation of what was going to go horribly wrong, instead of that lovely template error in test three?

No Comments yet »

« Prev - Next »