Beta 2 for VS 2008 was made available at the end of the last week. It inclues beta releases for standard, professional, team system editions and the MSDN library.

It also includes the beta 2 for the .NET Framework 3.5 and a CTP for the Silverlight add-in for VS 2008 that allows you working with Silverlight from VS 2008.

You can get the new beta from here: http://msdn2.microsoft.com/en-us/vstudio/default.aspx.

Hits for this post: 6316 .

A collegue of mine pointed me today to this web site, http://www.ivosoftware.com/, that offers a very interesting speech synthesizer, called IVONA. Without trying to advertise for it, I just want to say that I was surprized that one of the three languages that is supports is Romanian, and the it sounds quite good. You can check it for yourself here.

Hits for this post: 3349 .

Tonight (or should I say tomorrow), one minute past midnight the latest and last book of the Harry Potter saga, called “Harry Potter and the Deathly Hallows” will be released. But I’m sure you already knew that. Will Harry defeat the evil Lord Voldemort? Will he survive the endeavour? Obviously, the author is not saying anything. Todays, she’s baking a cake. While the fans across the world are baking too to grab the book and read it. I believe Harry will not die. She simply cannot kill the boy. There are too many million kids around the world idolizing the book, and the (not-so-little-any-more) wizard. She simply cannot take him from them. But Hermione will die. That’s my prediction. Let’s wait and see if I’m right.

My girlfriend already bought the book for me, I only hope to find the time to read it as soon as possible. Yeah, that’s right. I’m a fan too. ;)

Hits for this post: 7062 .

Today was launched the main site of Codexpert, the community for Romanian C++ programmers. For now you can check the latest news, what topics are active or unanswered on the forum, navigate to the community’s forum and wiki. In a short time we will start publishing articles, which you can send for now in HTML or Word document format to articole@codexpert.ro.

Visit and join us at www.codexpert.ro.

Astazi a fost lansat site-ul principal Codexpert, comunitatea programatorilor romani de C++. Deocamdata aici puteti citi ultimele stiri, urmari subiectele active sau fara raspuns in cadrul forumului sau naviga catre forumul si wiki-ul comunitatii. In scurt timp vom incepe sa publicam articole, pe care le puteti trimite in format HTML sau document Word la adresa de email articole@codexpert.ro.

Va asteptam sa ne vizitati la www.codexpert.ro si sa ni va alaturati.

Hits for this post: 5320 .

I am happy to announce you that together with Ovidiu Cucu and Dragos Cojocari (both Microsoft MVPs for VC++) have created CODEXPERT, a web site for the C++ developers in Romania and elsewhere the world. Except that all resources (including the main site, forum, articles, wiki, etc.) are in Romanian.

The goal of our project is to create a community for the many romanian programmers that use C++ in general and VC++ in particular. Currently the main web site in under construction, but we opened our forum and wiki. We encourage you to register and get involved in the community, either searching for help, or helping others. Or maybe both.

Here are the links you can follow:


Sunt bucuros sa va anunt ca impreuna ca Ovidiu Cucu si Dragos Cojocari (amandoi Microsoft MVP pe VC++) am creat CODEXPERT, un web site pentru dezvoltatorii de C++ din Romania, si lumea intreaga. Atat doar ca toate resursele (incluzand site-ul principal, forumul, articolele, wiki, etc.) sunt in limba romana.

Scopul proiectului nostru este crearea unei comunitati pentru numarul mare de programatori romani de C++ in general si VC++ in particular. In prezent site-ul principal este inca in constructie, dar am lansat forumul si wiki-ul. Va incurajam sa va inregistrati si sa va implicati in comunitate, fie pentru a gasi ajutor pentru diverse probleme, fie pentru a ajuta pe altii. Sau poate amandoua.

Mai jos sunt link-urile disponibile momentan:

Hits for this post: 5781 .

Microsoft has announced yesterday that Windows Server 2008, Visual Studio 2008 and Microsoft SQL server 2008 will all be released on 27 February 2008 at an event in Los Angeles.

In anticipation for the most significant Microsoft enterprise event in the next year, Turner announced that Windows Server® 2008, Visual Studio® 2008 and Microsoft SQL Server™ 2008 will launch together at an event in Los Angeles on Feb. 27, 2008, kicking off hundreds of launch events around the world.

That confirmed my guess that the release of Visual Studio would not happen this year, rather at the beginning of the next.

You can read the official announcement here.

Hits for this post: 6391 .

Recently I have updated my article published on CodeGuru about determining Windows version and edition. The update offers support for determining the Windows Vista and Windows Server 2008 edition installed on a machine.

Since both these new operating systems have the same major and minor version returned by GetVersionEx, i.e. 6 for major and 0 for minor, a first differentiation between the two is done based on the product type returned by the same function: 1 is used for Vista and 3 for Server 2008. To identify the edition a new function available in Vista and Server 2008 must be used: GetProductInfo. Based on the major and minor version of the product and the major and minor version of the service pack, it returns a number identifying the edition type. The article explains how to differentiate between Windows Vista Starter, Vista Home Basic, Vista Home Premium, Vista Enterprise, Vista Business and Vista Ultimate, as well as different editions of Windows Server 2008, such as Standard, Datacenter, Enterprise or Webserver.

The article offers source code that can be integrated in any C++ application, as well as a demo application.

Hits for this post: 9432 .

According to a Mexican finacial publication cited by The Guardian, Bill Gates is no longer the richest man on the planet. The new richest man is the Mexican businessman Carlos Slim Helu Aglamaz. Most of his business is in communication, and the surge in the shares of America Movil group put him on the top spot.

It remains to be seen whether Forbes will agree with the assessment and grant him the title of richest man on the planet for 2007. If so that will end the 12-years era of supremacy of Bill Gates.

Hits for this post: 4846 .

You probably noticed that IE7 or Windows Media Player 11 don’t have the menu shown by default; it only shows up when you press the ALT key. This is one particularity of the look and feel of Windows Vista Aero. You can find guidelines about designing menus here:

As revealed by the VC++ team some time ago, MFC 9.0 offers support for hiding the menus automatically and manually, in accordance with the Aero look and feel. A recent article in the MSDN Magazine by Tarek Madkour, explains how: by calling the SetMenuBarVisibility method from CFrameWnd with the AFX_MBV_DISPLAYONFOCUS. What is not told is that works only for SDI applications.

Menus in SDI applications 

In a SDI application you have a class derived from CFrameWnd, usually called CMainFrame. In the OnCreate() method, after calling the CFrameWnd’s OnCreate, you can call SetMenuBarVisibility:

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
   if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
      return -1; 

   SetMenuBarVisibility(AFX_MBV_DISPLAYONFOCUS); 

   // other stuff here 

   return 0;
}



AFX_MBV_DISPLAYONFOCUS is defined in afxwin.h:

// Frame window menu bar visibility styles
#define AFX_MBV_KEEPVISIBLE    0x01L // always visible
#define AFX_MBV_DISPLAYONFOCUS 0x02L // toggle state on ALT
#define AFX_MBV_DISPLAYONF10   0x04L // display on F10



The result is that the menu is automatically hidden (as can be seen in the image)

SDI menu is hidden 

and shown only when pressing the ALT key.

SDI menu is shown

Menus in MDI applications

The same technique does not work for MDI menus. In such an application you have

  • a main frame, represented by a (usually called) CMainFrame class derived from CMDIFrameWnd, which in turn is derived from CFrameWnd, and
  • one or more child frames, derived from CMDIChildFrame, which in turn is derived from CFrameWnd

Both the main window and the child windows can have menus, but the menu of a child window is shown on the same bar with the menu of the main window. As long as a child window exists the menu of that document is shown. When no child window exists the menu of the main window is shown. Both on the same bar.

Trying to make the menu of the child window(s) hidden by default does not work. Calling SetMenuBarVisibility has no effect:

int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
   if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
      return -1;

   SetMenuBarVisibility(AFX_MBV_DISPLAYONFOCUS);

   return 0;
}



Calling SetMenuBarVisibility for the main frame results in an assertion failure because the implementation in the CMDIFrameWnd expects the parameter to be always AFX_MBV_KEEPALIVE; it doesn’t do anything else, such as calling the function from the base class.

void CMDIFrameWnd::SetMenuBarVisibility(DWORD dwStyle)
{
   ENSURE_ARG(dwStyle == AFX_MBV_KEEPVISIBLE);
   ASSERT(m_dwMenuBarVisibility == AFX_MBV_KEEPVISIBLE);
}



Overriding the method in CMainFrame accept any parameter and call the method in CFrameWnd to bypass CMDIFrameWnd does not have any effect either.

void CMainFrame::SetMenuBarVisibility(DWORD dwStyle)
{
   CFrameWnd::SetMenuBarVisibility(dwStyle);
}



In conclusion MFC 9.0 supports the Aero look-and-feel for the automatically hiding of menus, but only in SDI applications.

Hits for this post: 13325 .

Windows Vista redesigned the way the file dialogs look. MFC 9.0 (that will ship with Visual Studio 2008) was updated to support the new look and feel. If you compile your MFC application with VS 2008 you get the new file dialogs with no additional change. On the other hand if you run the application under Win XP the old file dialogs are shown. This is possible because of an additional parameter to the constructor of CFileDialog. The old constructor signature was:

explicit CFileDialog(
   BOOL bOpenFileDialog,
   LPCTSTR lpszDefExt = NULL,
   LPCTSTR lpszFileName = NULL,
   DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
   LPCTSTR lpszFilter = NULL,
   CWnd* pParentWnd = NULL,
   DWORD dwSize = 0);



The new constructor in MFC 9.0 has an additional parameter, a BOOL flag indicating whether the Vista dialogs should be displayed of not.

explicit CFileDialog(
   BOOL bOpenFileDialog,
   LPCTSTR lpszDefExt = NULL,
   LPCTSTR lpszFileName = NULL,
   DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
   LPCTSTR lpszFilter = NULL,
   CWnd* pParentWnd = NULL,
   DWORD dwSize = 0,
   BOOL bVistaStyle = TRUE);



To display the Vista file dialogs, all you have to do is instantiate a CFileDialog object and create the dialog itself:

CFileDialog dlg(TRUE, NULL, NUL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
                L"Text files (*.txt)|*.txt||", this);
dlg.DoModal();



Vista look and feel file dialog

You can still use the old file dialog look and feel if you set the last parameter to FALSE:

CFileDialog dlg(TRUE, NULL, NUL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
                L"Text files (*.txt)|*.txt||", this, 0, FALSE);
dlg.DoModal();



Win XP look and feel file dialog

This old dialog is what you automatically get when running on a previous operating system.

Hits for this post: 13548 .