Oct 05 2009

Transparent WindowsForms controls & drawing on top of ProgressBar

Category: ProgrammingMaciek Talaska @ 7:02 pm

No, I actually have not given up posting blog entries :) My inactivity was caused by a lot of things that happened recently. I am changing my job, but it is not actually what I wanted to write today about ;) Some things seem to be simple until you really try to do it. It was exactly the case of one of the questions on StackOverflow that I found. So, how do you create a progress bar with text on top of it? Well, it seems that the easiest way to do it, is just to derive from Progressbar control, override OnPaint and use Graphics to draw anything, right? Well… the idea itself works for other controls but unfortunately not for ProgressBar. It is really strange, but ProgressBar control seems to ‘overdraw’ somehow everything what should be placed on top of it. The second problem is that WindowsForms controls does not support transparency. In WPF it is simple, what could be simpler than adding one attribute with specified opacity?

But hey… there are no things ‘impossible’ for software developers, right? I tried different approaches, and step by step I was just getting closer and closer to the final solution. Just to make it short: my solution is to create:

  1. a Label control with transparent background
  2. a user control that will hold ProgressBar and a label control (on top of progress bar). This control will be used instead of standard progress bar control.

 

  1. Creating label control with transparent background is a must, because assigning Color.Transparent to BackColor property of Label control does not affect the way the control is rendered. What you really need to do is to create a control, that derives from Label control, and add some code to make this control’s background transparent:
    public class TransparentLabel : System.Windows.Forms.Label
    {
        public TransparentLabel()
        {
            this.SetStyle(ControlStyles.Opaque, true);
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
        }
    
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x20;
                return cp;
            }
        }
    }
  2. Second control is just a standard UserControl, with a ProgressBar (Dock=Fill) and a TransparentLabel control placed on top of ProgressBar. Code:

        public partial class ProgressBarWithTransparentLabel : UserControl
        {
            public ProgressBarWithTransparentLabel()
            {
                InitializeComponent();
            }
    
            protected override void OnPaint(PaintEventArgs e)
            {
                this.progressBar1.SendToBack();
                this.transparentLabel1.BringToFront();
                this.transparentLabel1.Text = this.progressBar1.Value.ToString();
                this.transparentLabel1.Invalidate();
           }
    
            public int Value
            {
                get { return this.progressBar1.Value; }
                set
                {
                    this.progressBar1.Value = value;
                }
            }
        }
     

And… that’s it. You may also want to download complete source (C#) and see if it works for you (I do hope so!). Please, mind that I was creating it with Visual Studio 2010 Beta, so you may need to create a project/solution for yourself, and just copy the .cs files and add them to your project. Happy coding!

Oh, you may wonder why do I constantly invoke SendToBack and BringToFront methods in OnPaint – well, this is done to avoid this ‘overdrawing’ of anything was is being placed on top of ProgressBar. I don’t know why ProgressBar works like this, but… nevermind it just works this way, and if you want to use it, you have to live with it.

And just to prove, that I am not cheating ;)

image

ProgressBarWithTransparentLabel (7)

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Reddit
  • TwitThis

Tags:


May 10 2009

Scintilla.NET Control & GDICharSet

Category: ProgrammingMaciek Talaska @ 12:53 am

TextBox and its variations are one of the most widely used controls. Sometimes it is much better to devote your time to something different than creating more sophisticated version of TextBox control, that will have all the features you need. For one of my projects I was looking for a TextBox control, that will provide line numbering and a bunch of other (not very sophisticated) editing features. After Googling for a while, I have found Scintilla.NET Control. This is just a managed wrapper for Windows native version of this control. Managed API is a bit messy, but still – it saved me tons of time I would have to spend developing my own editing control otherwise.

One of the problems I faced while using ScintillaNet control is… properly setting font for the control. Why is that so important? Although my app is not multicultural, I want it to allow people use all diacritical characters in the language of their choice. Using standard TextBox control you just change font in a couple of lines:

FontDialog fd = new FontDialog();
fd.FontMustExist = true;
if (fd.ShowDialog(this) == DialogResult.OK)
{
    this.textBox1.Font = fd.Font;
}

This is pretty easy, right? The only interesting thing here is that even if you do not specify a proper “Script” (what specific version of the font you want to use: Western, Greek, Turkish, Baltic, Central European, Cyrillic, Vietnamese) you will be able to use diacritical character for the language of your choice (if you do not believe me – check it!).

ScintillaNET Control behaves different. If you do not specify explicitly additional options regarding character encoding – diacritical characters will not be available for use in that control. It is important to notice, that there is special option (I mentioned above) connected with character encoding in FontDialog available in System.Windows.Forms namespace:

image

Picture 1. Standard .NET FontDialog

Notice that below textbox that present how will actual setting affect font outlook, there is an option entitled “Script” – this one is used to use a proper “character set” of chosen font. If you want to – for example – use some Slavic diacritical characters you should choose “Central European” instead of “Western”.

But even if you do so, you still will not be able to use diacritical characters in ScintillaNET Control. What is the problem, then? There are two problems to be precise:

  1. if you use application settings to store your font (and I do) than you must be aware, that the font that you load through Application Settings may not be exactly the same as the font you saved. You need to create a proper font from the font stored in application settings.
  2. after creating font that will have properly set information about code page, you need to set encoding in ScintillaNET Control, and activate the font.

You may wonder, how is that possible that font loaded from application settings differs from the one that was stored in application settings – the problem is that information about GDI character set is not being stored. So, if the font you have selected had GDI character set set to any value other than default – the value is being lost at the moment of saving font in application settings. You may overcome this problem, storing GDI character set for the specified font. Next thing, you should do, after loading font from application settings is to set its GDICharSet property, so the font will be exactly the same as the one that was saved. Unfortunatelly, GDICharSet property is read-only, so there is no single-line solution for this problem. First solution that came up to my mind was to use LOGFONT structure to create a font that will have properly set its GDICharSet. To do this, you need to create a definition for the LOGFONT structure:

using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential)]
public class LOGFONT
{
    public const int LF_FACESIZE = 32;
    public int lfHeight;
    public int lfWidth;
    public int lfEscapement;
    public int lfOrientation;
    public int lfWeight;
    public byte lfItalic;
    public byte lfUnderline;
    public byte lfStrikeOut;
    public byte lfCharSet;
    public byte lfOutPrecision;
    public byte lfClipPrecision;
    public byte lfQuality;
    public byte lfPitchAndFamily;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FACESIZE)]
    public string lfFaceName;
}

a sample function that creates font that will have properly set GDICharSet property could look like this:

private Font CreateFont(Font f, byte gdicharset)
{
    LOGFONT logfont = new LOGFONT();
    logfont.lfFaceName = f.Name;
    logfont.lfHeight = f.Height;
    logfont.lfCharSet = gdicharset;

    return Font.FromLogFont(logfont);
}

It is quite easy, right? But… it could be even easier :) If you look closely to all the Font constructors, you’ll notice, that there is one, that takes GDICharSet as an argument – this is just the thing you’ll need. The whole 5-line long function presented above could then be replaced by a single line of code (that does exactly the same):

Font f = new Font(defaultfont.FontFamily, defaultfont.Size, defaultfont.Style, defaultfont.Unit, gdicharset);

And of course, you do not have to define LOGFONT anymore ;) Ok, so now the font has the GDICharSet properly set. If you want the control to be able to use diacritical characters, you have to set some of its properties. I have spent quite some time to figure it out which properties should be set, and discovered that even the order of setting properties is important! So, to save you some time, I’ll just paste the code I use to properly initialize ScintillaNET Control in my application:

ScintillaNet.CharacterSet charset = (ScintillaNet.CharacterSet)gdicharset;
this.content.Styles.Default.CharacterSet = charset;
Font f = new Font(defaultfont.FontFamily, defaultfont.Size, defaultfont.Style, defaultfont.Unit, gdicharset);
this.content.Styles.Default.Font = f;
this.content.UseFont = true;
this.content.Encoding = System.Text.Encoding.GetEncoding(encodingName);

So that’s it. I really recommend using ScintillaNET Control – it is feature rich and free. It lacks up to date documentation and recently its development seems to be frozen, but it may be a good thing to take a look at it before deciding to develop your own TextBoxWithALotOfFeatures control :)

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Reddit
  • TwitThis

Tags: , ,


Apr 14 2009

What have I learned thanks to SyncToy?

Category: Programming, Windows, my projectsMaciek Talaska @ 12:28 pm

If you haven’t used SyncToy – it is high time to check what it can do for you. In short: this is a great synchronization tool, originally written to help photographers (or amateur photographers) synchronize between their studio storage devices (computers) and mobile data banks. I have started using SyncToy to synchronize content on two of my disk (I want one of them to be the exact copy of the other one). The disk are quite big (about 200GBs) so doing a “preview” of changes takes a while. Yesterday although, SyncToy was unable to finish preparing preview, because there were some files / folders with invalid chars in their names. The problem is known to both sides: SyncToy users and Microsoft’s developers, but suggested solutions didn’t help me at all (I didn’t know what exact file or directory is causing problems to SyncToy).

So… I make a quick look at what can I find inside System.IO, and Path.GetInvalidPathChars() and Path.GetInvalidFileNameChars() – it seemed that those functions will help me find those files and directories that contains illegal characters. Boy… I was wrong ;)

At the beginning I wrote a very simple program (C#) that recursively traversed through all FileSystemInfo objects (using GetDirectories() and GetFiles() methods) present in a given directory. The problem was, that when GetFiles() method was invoked inside a directory that contained files with illegal characters – program crashed (“Illegal Argument Exception”). I couldn’t understand it. I know what was the directory that caused problem and I easily found a file that was a cause of all this mess. The file name contained a pipe “|” character that is not allowed (at least on Microsoft’s systems).

I wondered how should I change my small utility to make it able to find all illegal files and generate a cute report at the end instead of crashing. I could see the file using Total Commander, Windows Explorer and even dir command executed within cmd.exe. I could – however – copy the file, rename it (tried bazylion of different approaches to achieve this task – using Universal Naming Convention didn’t help a bit). I decided to rewrite main part of my utility and to use System.Diagnostics.Process and output of “DIR /A-D /B” for files and “DIR /A:D /B” for directories. My idea was to not checking the names of FileSystemInfo objects that I can get without problems using GetFiles and GetDirectories methods. I assumed (and I hope that it is assumption is correct) that if information about a file or directory can be get, than there is no problem with this object. So I decided that my code should now look more like this:

try
{
    FileInfo[] files = root.GetFiles();
}
catch (System.UnauthorizedAccessException)
{
}
catch
{
    GetSystemEntries(root, EntryType.File);
}

In the function that traverses through all the object there is another similar block of code that does similar task but for directories. I wasn’t sure if this approach is ok – exception catching influences performance, but it didn’t take more time than SyncToy to look through all my drive (so I assume that the performance is acceptable). GetSystemEntries is a function written by me, that invokes dir command in specified directory looking for files or directories, and analyzes output (checks if there are any invalid characters in file or directory name).

Yup, one problem resolved. But what about the file? As far as I remember, it was created by a browser (saving page) and it’s name comes from the title of the page, which was divided in sections using pipes. The funny thing (for me) is that I can not understand how OS may actually allow anyone to create a file with invalid characters in name (I suppose this file was created by Mozilla Firefox 3.0x). I have spent a lot more time looking for a solution how to delete the file, rename it, or do whatever to make it a file with a valid name. Back in the old dos-command-prompt days I used several times a great tool by Norton – diskedit.com – it was very powerful disk editor, that saved me a couple of times. But… although I found some similar tools, I was a bit too afraid to use them. NTFS is much more complicated than good-old FAT, and I really didn’t want to lose all my data. I rebooted to Ubuntu, and tried renaming. It worked. Then I tried to remove the file. No problems. So… thank you Cannonical :)

App sources are available on this blog.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Reddit
  • TwitThis

Tags: , ,


Feb 28 2009

Multidimensional arrays in C++

Category: ProgrammingMaciek Talaska @ 11:17 pm

Dynamic, multidimensional arrays are not supported directly by C++. If you create such an array in following way:

array = new int*[_size];
for( unsigned int i = 0; i < _size; i++ )
    array[i] = new int[_size];

you are in fact creating one dimensional array of pointers to other arrays. Main two disadvantages of this approach:

  • Initialization can take a while (image really big 2-3 dimensional array, lets say: 16384 x 16384: how many times memory allocation is being performed? 1 + 16384. Quite a lot, right?
  • dynamic arrays created like in the code above can not be used as a parameters for memcmp, memcpy, memset & similar functions. the memory allocated is not a continuous memory block.

As I needed a 2-dimensional array that occupies continuous block of memory – I started googling :) I have found a great solution by  David Maisonave (Axter) (code, header). The code above could be rewritten as follows:

Pixel** Initialize2dArray( int size )
{
    Pixel **array2d;
    Pixel *temp;
    array2d = new Pixel*[size];
    temp = new Pixel[size * size];

    for( int i = 0; i < size; i++ )
    {
        array2d[i] = temp;
        temp += size;
    }
    return array2d;
}

void Deinitialize2dArray( Pixel** array2d )
{
    delete [] *array2d;
    delete [] array2d;
}

 

How does it work? The idea is to put in every ‘cell’ of the array a pointer that will point to a part of the ‘temp’ array. The parts are of the ‘width’ size. So, when you type array[2][3] it actually selects the data that is indexed 2 * width + 3 = exactly what you’re expecting, right? But beware, there is a little difference when using array created in described way and all those mem* functions I wrote at the beginning, instead of writing:

memcpy( array2d, source, sizeof(int) * size * size );

you actually need to write:

memcpy( &array2d[0][0], source, sizeof(int) * size * size );

It is great, right? And, of course, you could try using std::vector (it allocates continuous block of memory – correct me if I am wrong) or Boost Multi Array instead – but if you’re worrying about performance… I think the presented solution is the best.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Reddit
  • TwitThis

Tags:


Feb 22 2009

CUDA & C++ integration

Category: Programming, Visual StudioMaciek Talaska @ 10:08 pm

It is kind of a strange, but it is not so simple as you may think. There is a sample project in CUDA SDK, and it works, but… it is strange that if you exclude all .cu and .cpp files and add yours… surprisingly it stops working. Why? There were some problems while linking: I got messages that there are bunch of symbols already defined elsewhere. Well… in this case it is because of LIBCMTD (but read further please, it is not always the problem with LIBCMTD) – default library that is being linked by VS. How to overcome this problem? There are two solutions:

  • you may add “/FORCE:MULTIPLE” in linker options (Project properties –> Linker –> Command Line) – but this does work… partially – it creates proper executable, but in my case I got some assert exception at the very end of executing my app (actually it was when all resources were to be freed – but I didn’t want to investigate it further – app worked, but it is strange to see the exception dialog all the time)
  • you may exclude one of the libraries that is causing the problem. Which library? Well, it depends on: what was your project type (Linker –> System –> Subsystem: /SUBSYSTEM:CONSOLE, /SUBSYSTEM:WINDOWS…). In the sample form CUDA SDK, the library that you should get rid of (Linker –> Input –> Ignore Specific Library; remember to write only library’s name, without extension) is: LIBCMTD, in my own project (created from scratch) it is: MSVCRTD for Debug, and LIBCMT for Release. The only advise is to look carefully at what is your linker spitting out, and just ignoring this specific library that makes the whole process to fail (and it is very good idea to have more verbose output: Linker –> General –> Show Progress: /VERBOSE:LIB or even /VERBOSE). In my case the BuildLog.htm (automatically produced by VS) contained following information:

[...]

MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)

[...]

Finished searching libraries LINK : warning LNK4098: defaultlib ‘MSVCRTD’ conflicts with use of other libs; use /NODEFAULTLIB:library

[...]

As you see, the problem lies in linking MSVCRTD.lib. Although it is not always so easy. Sometimes different library should be excluded from the process of linking.

It seemed to me, that the problem was fixed. I was wrong. Something bothered me. Why there were no simple solution for this problem? And why the problem was not always with the library the linker had problem with (the one, that it informed about problems with)? And than I started thinking about something I read about how Microsoft C++ compiler / linker works: there are bunch of libraries that are included by default. The libraries are organized in groups (compiled with debug info for debug purposes, etc.), and compilation or linking and mixing libraries with two different worlds may lead to errors. If you right click on your .cu or .cpp file in your project and navigate to “General C++ –> Code Generation” (in case of .cpp file) or “CUDA Build Rule v.2.1.0 –> Hybrid CUDA/C++ Options” (in case of .cu file), you’ll see “Runtime Library” option. And if all your files share the same setting, the problem with linking disappears, and now I am sure, that this is the right solution :) And remember, that this option for all the files must be exactly the same! “Multi-Threaded” and “Multi-Threaded DLL” are NOT the same (the have different linker switches), so just be careful, and pay attention what you change.

I hope it helps someone, because I have wasted a bit of time.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Reddit
  • TwitThis

Tags: ,


Feb 16 2009

Intellisense for CUDA in VS 2008

Category: Programming, Visual StudioMaciek Talaska @ 11:03 am

In the previous post I have written about using CUDA from Visual Studio IDE. Syntax highlighting is very easy to achieve – because nVidia delivers files and information about enabling syntax highlighting for CUDA in CUDA SDK. The thing is, that when you start developing anything that uses CUDA, you feel like being back in the mid ‘90 – there is no Intellisense, no auto-completion and other features of modern IDEs that most of developers are used to. 5 sec googling and you got the solution. But hey… why doesn’t it work? Well I think it is because someone who wrote about it had special pack of Unix programs for Windows installed (Cygwin). There are no “rm” or “cp” commands under Windows (at least on my copy of Windows they seem to not exist ;) The easiest way to make it work under any Windows is to replace:

rm $(InputName).cu
cp $(InputFileName) $(InputName).cu

with:

copy /Y $(InputFileName) $(InputName).cu

That’s it. It should work now. And remember that you need to have both files (.c and .cu) in your solution (because the idea behind it is to generate .cu from .c, and compile only .cu).

Anyway, that shows how powerful the Custom Build Rules are, aren’t they?

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Reddit
  • TwitThis

Tags: , ,


Feb 15 2009

VS 2008 & CUDA

Category: Programming, Visual Studio, WindowsMaciek Talaska @ 3:45 pm

As a proud owner of nVidia graphic card (and being some kind of a fan of nVidia for their effort into graphics programming) I decided to go and try CUDA. At the moment the newest version is 2.1. The first thing after installing something you want to try out is to go and look at the samples, right? The same thing I thought, but unfortunately there were some problems compiling samples from nVidia CUDA SDK.

I tried to compile one of the simplest samples, but I instead of success I saw error message:

1>—— Build started: Project: cudaOpenMP, Configuration: Debug Win32 ——
1>Compiling with CUDA Build Rule…
1>"C:Program FilesnVidiaCUDAbinnvcc.exe"   -arch sm_10 -ccbin "C:Program FilesMicrosoft Visual Studio 9.0VCbin"    -Xcompiler "/EHsc /W3 /nologo /Od /Zi   /MTd  " -IC:Program FilesnVidiaCUDAinclude -I../../common/inc -maxrregcount=32  –compile -o DebugcudaOpenMP.cu.obj cudaOpenMP.cu
1>nvcc fatal   : A single input file is required for a non-link phase when an outputfile is specified
1>Linking…
1>LINK : fatal error LNK1181: cannot open input file ‘.DebugcudaOpenMP.cu.obj’
1>Build log was saved at "file://d:MDTempProjectsCUDAprojectscudaOpenMPDebugBuildLog.htm"
1>cudaOpenMP – 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

(this is copy & paste from  VS Output window)

and the error in VS Error Window:

Error    1    fatal error LNK1181: cannot open input file ‘.DebugcudaOpenMP.cu.obj’    cudaOpenMP    cudaOpenMP

The error enlisted in VS Error window is connected with linker (it is unable to find input file) so the real problem lies somewhere else: at the compile time. I have copied the command line that invokes nVidia’s compiler (because no other compiler is aware of all the extension nVidia created for the purpose of creating CUDA). The command line was:

"C:Program FilesnVidiaCUDAbinnvcc.exe"   -arch sm_10 -ccbin "C:Program FilesMicrosoft Visual Studio 9.0VCbin"    -Xcompiler "/EHsc /W3 /nologo /Od /Zi   /MTd  " -IC:Program FilesnVidiaCUDAinclude -I../../common/inc -maxrregcount=32  –compile -o DebugcudaOpenMP.cu.obj cudaOpenMP.cu

Do you see the problem? Well, I didn’t see what’s wrong at the first sight too ;) Anyway, to cut it short: the problem lies in the path where nVidia CUDA SDK is installed. I have chosen to install it in “Program FilesnVidia” and not in the root directory (this is the default location – as far as I can remember). The thing is that Program Files without quotes is treated… yup, you guessed ;) everyone familiar with the way command lines arguments are being passed to programs knows that space IS a delimiter. OK. What is the solution? Very, very simple, you need to change a bit the “CUDA Build Rule”, and to change it, you need to do the following:

  1. Open your VS and open any project / solution from nVidia CUDA samples
  2. Right-click on project (not on solution) and click on “Custom Build Rules”, you should see a dialog:
    image
  3. Choose “Cuda Build Rule v2.1.0” and click on “Modify Rule File…” button, another window will pop-up:
    image
  4. Click on “Cuda Build Rule” and then on “Modify Build Rule…”
     image
  5. And finally this is the window you need to make changes in. The “Include” property (highlighted) need to be modified (simply: put [value] into quotes, so the switch for Include will look like: –I”[value]”. Now your project should compile without any errors or warnings (I assume that you’re compiling one of the nVidia CUDA samples).
  6. Remember that you may have to add (register) .cu files in VS environment, but it is clearly described in readme.txt located in /doc/syntax_highlighting in your CUDA SDK directory.

The same kind of problem you may have after installing Python and some python IDEs that modify environment and add PYTHONPATH. If you install Python in “Program Files” the same thing happens. The solution is to edit your PYTHONPATH variable and change it, instead of “Program Files” you may type “Progra~1” (check what is yours “Program Files” directory 8+3 name using “dir /X” command).

Hope it helps. Happy coding!

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Reddit
  • TwitThis

Tags: , ,


Jan 28 2009

BitsMonitor on CodePlex!

Category: Programming, my projectsMaciek Talaska @ 7:56 pm

I just released BitsMonitor on CodePlex. There is a default release containing 32bit binaries, all the sources are available to download from CodePlex site. I have spent last couple of days preparing first public release of another of my spare-time projects, but it is still not ready. I plan to release it next week.

BitsMonitor is being released under MIT license (so, you may do anything you want with it, almost everything ;) There is something that bothers me – I have used BITS Interop code provided (as a part of solution attached to an article) by J.Clark in MSDN Magazine article. And my question is: what is the license of all the sources released as a part of MSDN Magazine articles? Are the sources free? Did I violate the license or not (by including part of J.Clark solution in my own project)? I have found a question somewhere on MSDN forum concerning that issue, but there were no answer given. I have contacted J.Clark, but didn’t get any answer until today (almost a week have passed). If you know more about MSDN Magazine licenses for source code – please let me know!

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Reddit
  • TwitThis

Tags: , ,


Jan 23 2009

Windows 7 – correction

Category: WindowsMaciek Talaska @ 11:06 am

In the previous post I wrote, that there are some some strange behaviours concerning Windows7 performance. Although, it seems that it wasn’t Windows7’s fault. Performance drop was caused by antivirus software (yes, the real-time protection was enabled). My desktop hardware that I use as a test machine seem to be very, very weak for nowadays apps, so running antivirus caused big difference in performance. Turning it off, mad all the problems with "application takes a lot of time to start" to disappear. But I still have the impression that Windows7 was much faster at the very beginning (right after installation was complete) and its performance dropped after installing a few applications (and applying some Windows Updates).

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Reddit
  • TwitThis

Tags:


Jan 20 2009

Windows 7 – first impressions

Category: WindowsMaciek Talaska @ 10:24 pm

Yesterday I made a decision to try out Windows 7. For my surprise it was way easier than I expected. Installation went without even a minor problem. After about 40 minutes (maybe a bit longer) system was set up. I have installed the system on my quite old (ok, I admit it, it almost ‘ancient’) desktop PC: Athlon XP 2200+, 1.5GB of RAM, GeForce FX5900XT (GeForce 5 series), ASUS AV880 mainboard and old Seagate 40GB hard drive (quite old ATA drive) – I didn’t want to spoil my system. The only thing I was wondering about after the installation was, why Windows 7 didn’t recognize the graphics card. I know that it is old, but I was quite surprising that right after installation it was detected as ‘generic VGA adapter’. Anyway, after couple of minutes I had it working with the best drivers I found on nVidia’s site (it is great that Windows 7 is able to use Vista drivers). The other thing that didn’t work out-of-the-box was sound driver. ASUS mainboard on which the desktop PC is built has some strange AC97 compatible on-board sound, which I believe is ‘not the best one’ (I think full chip name is: ADI SOUNDMAX, or something similar). Searching for sound driver could have been much more exhausting, but… I had the driver prepared ;) I found it while installing Windows Vista. If you have problems with similar sound hardware search for “wdm_3665.zip”, unzip it, and choose the installation with ‘have disk’ method (the proper driver is in on of extracted folders – the one that contain files for Windows 2k / XP). Anyway, after about and hour, everything was configured, and I could have started using the system.

First impression was: wow, it really seems that this is a bit faster than Vista. But this impression didn’t last long. After installing couple of applications everything slowed down, and I started noticing some strange things: sometimes it takes a lot more time to launch some apps. Much more comparing to Vista or XP. You can even thing that app hung while loading, but it just need a bit more time to start. And it does not only affects big apps, I have this problem with Total Commander – after clicking it’s icon, it shows screen with my registration data for a couple of seconds, and then starts. It’s not a big problem, but rather something you would expect to be fixed.

I can’t get used to the new taskbar. There is (by default, it can be changed) no ‘quick launch’ (well, the standard one), the idea of making programs icons, that are launched a bit more ‘rounded’ is not the best – in my opinion. It is quite hard to know at the first sight which program is actually run, and which doesn’t. The cool thing is, that if you’re downloading file using Internet Explorer the icon on the taskbar shows actual downloading progress – I like it. And even IE8 beta is quite nice, the first impression is very, very positive, but it is gone, when it hangs (it seems that IE’s JavaScript engine lacks some performance) on Windows Live site. I must admit, that I had some problems with printouts – it is strange, because the same program generates proper printouts on Windows XP (I was printing to .pdf files in both cases).

There are dozens of small changes in Windows’ UI – but I am sure you already read about them, so I won’t repeat it. System is very stable, there is no ‘ah… this is beta…’ feeling. Taking under consideration Microsoft’s software release cycle, BETA 1 (which Windows 7 BETA build 7000 is) is never optimized for performance. It may consume less memory than Vista (although I didn’t check that, so I am not sure) but one may be disappointed if expecting huge performance boost (again: comparing to Vista). At the moment there is no point in comparing those two versions of Windows, because of immaturity of Windows 7 (everyone expect it to be Vista killer, we’ll see in next couple of months). So what’s the point in installing Windows 7? There are some new features you may be interested in (shortcuts, famous ‘make window half screen wide’ feature and alike). Concepts of home network and document libraries (did they take the WinFS back from grave?) are very interesting. If you have some free GB’s on your hard drive – I think Windows 7 is definitely worth installing.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Reddit
  • TwitThis

Tags:


Next Page »