Monthly Archives: December 2011

C++11 FAQ from Bjarne Stroustrup

Available on ATT web site and Bjarne Stroustrup (inventor of C++) space, here a FAQ for C++0x named C++ 11.

FAQ C++ 11 : http://www2.research.att.com/~bs/C++0xFAQ.html

To learn about specific chapters of the langage, see the DRAFT (which is very closed to the final paper): http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf

PPL explained easy !

PPL is part of Visual C++ 2010 CRT…

ppl-1.3.pptx

shared_ptr explained simple !

To find advanced STL topics, check out Advanced STL channel9 sessions :

See Part 1 -> shared_ptr and friends
See Part 2 -> Algorithm optimization
See Part 3 -> STL’s comprehensive correctness checks
See Part 4 -> rvalue references, perfect forwarding, associative containers

See part 5 -> http://channel9.msdn.com/Shows/Going+Deep/C9-Lectures-Stephan-T-Lavavej-Advanced-STL-5-of-n

vis-1.1.pptx

PPL tasks updated

PPL is located under the C runtime aka CRT.

Try this updated preview header for Windows 8 async programming: view ppltasks.preview.h here ppltasks.preview

Download at http://code.msdn.microsoft.com/windowsapps/Windows-8-Asynchronous-08009a0d

C++ for kernel mode : pros and cons

C++ in kernel mode. Pros and Cons.

The essence of power and performance.

http://msdn.microsoft.com/en-us/windows/hardware/gg487420.aspx

Enjoy the CRT!

Check this channel9 topic about CRT.

http://channel9.msdn.com/Shows/Going+Deep/C9-Lectures-Mahmoud-Saleh-Advanced-CRT

C Run-time (CRT).pptx

CRT_Topics_P2.pptx

Microsoft TechDays 2012 Paris – France

I will be proud to present a C++ session with a MCS Microsoft guy. It will be titled “Writing modern C++ code”

More informations:

http://www.microsoft.com/france/mstechdays/programmes/parcours.aspx#DomID%3dea15c71c-3db4-4b33-9e36-83728807ed26%26SessionID%3d13383a46-f584-49aa-81df-020a1540adf7

VS and a Ribbon (MFC prototype)

Thinked after a couple of hours spent on Visual Studio 2011 Refersh UI – VS 11 Metro UI program… NDA.
Some features of the Visual Studio Shell could be explained as a standard Office UI Fluent Interface a.k.a. a Ribbon based UI.

books Oldies but Goodies

I needed some GDI stuff about scroolbar, CScrollView and others viewport and DPtoLP()… Drawing in the Windows C++ world requires some books !
Remember the old Petzold & Kruglinsky times ?

How to program a Ribbon based UI using MFC

Just declare a small set of stuff in your MainFrame class:

protected:
CMFCRibbonBar m_wndRibbonBar;
CMFCRibbonApplicationButton m_MainButton;

Implement it as:


void CMainFrame::InitMainButton()
{
m_MainButton.SetImage(IDB_RIBBON_MAIN);
m_MainButton.SetToolTipText(_T("File"));
m_MainButton.SetText(_T("\nf"));
m_wndRibbonBar.SetApplicationButton(&m_MainButton, CSize(45, 45));
CMFCRibbonMainPanel* pMainPanel = m_wndRibbonBar.AddMainCategory(_T("File"), IDB_RIBBON_FILESMALL, IDB_RIBBON_FILELARGE);
pMainPanel->Add(new CMFCRibbonButton(ID_FILE_NEW, _T("&New"), 0, 0));
pMainPanel->Add(new CMFCRibbonButton(ID_FILE_OPEN, _T("&Open..."), 1, 1));
pMainPanel->Add(new CMFCRibbonButton(ID_FILE_SAVE, _T("&Save"), 2, 2));
pMainPanel->Add(new CMFCRibbonButton(ID_FILE_SAVE_AS, _T("Save &As..."), 3, 3));
std::auto_ptr<CMFCRibbonButton> apBtnPrint(new CMFCRibbonButton(ID_FILE_PRINT, _T("&Print"), 4, 4));
apBtnPrint->AddSubItem(new CMFCRibbonLabel(_T("Preview and print the document")));
apBtnPrint->AddSubItem(new CMFCRibbonButton(ID_FILE_PRINT_DIRECT, _T("&Quick Print"), 7, 7, TRUE));
apBtnPrint->AddSubItem(new CMFCRibbonButton(ID_FILE_PRINT_PREVIEW, _T("Print Pre&view"), 6, 6, TRUE));
apBtnPrint->SetKeys(_T("p"), _T("w"));
pMainPanel->Add(apBtnPrint.release());
pMainPanel->AddSeparator();
pMainPanel->Add(new CMFCRibbonButton(ID_FILE_SEND_MAIL, _T("Sen&d..."), 8, 8));
pMainPanel->Add(new CMFCRibbonButton(ID_FILE_SUMMARYINFO, _T("Summary &Info..."), 9, 9));
pMainPanel->AddSeparator();
pMainPanel->Add(new CMFCRibbonButton(ID_FILE_CLOSE, _T("&Close"), 5, 5));
pMainPanel->AddRecentFilesList(_T("Recent Documents"));
pMainPanel->AddToBottom(new CMFCRibbonMainPanelButton(ID_TOOLS_OPTIONS, _T("Opt&ions"), 10));
pMainPanel->AddToBottom(new CMFCRibbonMainPanelButton(ID_APP_EXIT, _T("E&xit"), 11));
}

Explore the Visual C++ sample called DrawClient located in MFC\Visual C++ 2008 Feature Pack\DrawClient !

VS with a Ribbon UI

Have you ever wonder why VS does not have a Ribbon UI ?