DCSIMG
C++ - Pavel's Blog
Sign in | Join | Help

Pavel's Blog

Pavel is a software guy that is interested in almost everything
software related... way too much for too little time

Browse by Tags

December Windows Platform User Group Meeting
16 November 11 12:41 PM | pavely | with no comments
The next UG meeting is to be held on December 5th, and will feature Visual C++ AMP (and other good stuff). Use the following link to get full details and register: http://vcppamp-dec11.eventbrite.com/ See you there!
Some of My Favorite Small C++11 Features
13 October 11 04:25 PM | pavely | with no comments
The new C++11 standard, finally finalized (pun intended) contains dozens of features, both in the language and in the libraries. Some of those features are pretty complex (or at least less often used), but some are practically essential, and have been sorely missed (at least by me) since forever. Here’s a quick list of those small, simple, features that I like. it’s sometimes surprising to C# or Java developers that some of these features didn’t exist in C++ prior to C++11 (technically, C++03 or...
C++ Tip: Go away, sprintf!
05 September 11 07:02 PM | pavely | 1 comment(s)
Recently I did some teaching of an Advanced C++ course, for various audiences. I noticed that many people coming from a C background sometimes have a hard time abandoning the “old way” of C style programming and thinking. This is hardly new or surprising. I try, whenever possible, to point out the C++ way of doing things, where a legacy C alternative exists. One of the obvious culprits is the infamous printf C function. That’s probably the first function to be learned by a C (and maybe even C++)...
תגים:,
Reminder: WPDUG September Meeting
04 September 11 01:05 AM | pavely | with no comments
This Wednesday (the 7th) will hold a Windows Platform Developer User Group meeting in Microsoft’s offices in Ra’anana (Israel). Our first session will be about adding realtime and deterministic capabilities to Windows and its impact on the system and the ways to program such a system (all based on addons by a company called TenAsys ). The second session will demonstrate useful (and undocumented) debugging tips and tricks in Visual Studio (primarily for native developers). Should be interesting for...
GetShellWindow vs. GetDesktopWindow
18 June 11 09:06 PM | pavely | with no comments
In his post about running a process as a standard user from an elevated process, Aaron Margosis uses a technique that gets the access token of the shell process (typically explorer.exe) and uses that token to launch the new process ( Sasha Goldshtein also blogged about that). The first thing his code does is try to locate the shell process id. One way is to look for “explorer.exe” in the list of processes, but that’s a bit limiting, as there may be a different shell, or it may have been renamed for...
More Media Info with Media Foundation
28 March 11 07:07 PM | pavely | with no comments
Getting information on media files is possible through Media Foundation, as we’ve seen , using the various “descriptors”. If we look at Windows Explorer, we can see other information presented, such as artist, title and other metadata. This information is also accessible through media foundation, without resorting to the (mostly) dreadful shell API. To get to these properties, we can query the media source for the IMFGetService , which is conceptually similar to IServiceProvider used in various APIs...
Technology Radio Show, Part 2
21 March 11 10:03 AM | pavely | 3 comment(s)
The second part of the technology radio show on 106.4 FM aired on last Thursday. As with the first part , I was the “Microsoft guy”. This time we were missing the iPhone and Ruby guys, but the show was more to the point (somewhat). You can listen to the recording (if you’re kinda really really bored) here (look for the March 17 show).
תגים:, , , , , , ,
Getting Media File Info
20 March 11 11:55 AM | pavely | 3 comment(s)
So, what can we do with Media Foundation? One of the simplest things, perhaps, is getting information on some media file, somewhat similar to what we see in Windows Explorer, but we can dig deeper if we like. Let’s get started. First, we’ll create a simple Win32 console application named MediaInfo (I check the box to include ATL headers, we’ll use ATL smart pointers). We then add some Media Foundation includes (e.g. in StdAfx.h): #include <mfidl.h> #include <mfapi.h>   These are...
Introduction to Windows Media Foundation
07 March 11 11:26 PM | pavely | 3 comment(s)
I’ve been writing a new course on this technology, so I thought I’d share some of my experiences with the Windows Media Foundation. What is Windows Media Foundation? The Windows Media Foundation is technically the successor of DirectShow (which is still around and very much supported), introduced in Windows Vista and enhanced in Windows 7. It’s a multimedia platform, capable of playing, analyzing, writing and otherwise transforming media (mostly video & audio, but can technically be anything...
Technology Radio show that I participated in
02 March 11 08:40 PM | pavely | 1 comment(s)
Last week I was invited to a radio show called “Technofobia” (origin in Hebrew) in the Interdisciplinary Center (IDC) in Hertzliya (Israel) (106.4 FM). This was a “special” talk about development technologies. There was a Ruby guy, a Python guy, a C++ guy (actually a girl), an iPhone guy (the famous Yossi Taguri ) and myself, as the “Microsoft guy”. I had to repeatedly (and during the music breaks) tell the hosts that I don’t work at Microsoft, I just use, teach, mostly like and develop with those...
תגים:, , , , , ,
C++ 0x, Will you save C++?
05 February 11 08:20 PM | pavely | 13 comment(s)
The emerging new standard of C++ (dubbed C++0X, where X was supposed to be a decimal digit, but now can be considered a hexadecimal digit) will probably be finalized and approved this year (probably to become “C++11”), and is supposed to march C++ into a new era of productivity. Will that actually happen? In recent years, I saw declining usage of C++ in “regular”, data driven applications, UI and graphic applications, in lie of other environments, namely .NET and Java. As I do a lot of training,...
Visual Studio 2010 SP1 Beta: What’s new in MFC?
25 December 10 03:23 PM | pavely | with no comments
The recently released Visual Studio 2010 SP1 Beta brings many enhancements and bug fixes found since the product’s launch, most of them in the managed world. However, there are new enhancements to the good(?) old MFC , namely wrapping of some of the Direct2D interfaces. Direct2D is a new layer in the DirectX world, sitting on top of Direct3D, providing high performance and flexible 2D graphics. It was introduced with Windows 7 and Windows 2008 R2, but it’s also possible to install it on Windows Vista...
The Case of the Unexplained Sharing Violation
24 November 10 04:19 PM | pavely | with no comments
(pardon to Mark Russinovich for the title “The case of…”). This seemingly innocent code caused a sharing violation error (32) after a few iterations:     for ( int i = 0; i < 10000; i ++) {       sprintf_s ( text , "Text from process %d\r\n" , GetCurrentProcessId ());         HANDLE hFile = CreateFile ( _T ( "c:\\temp\\test.txt" ), GENERIC_WRITE , 0 , 0, OPEN_ALWAYS , 0, 0);       if ...
תגים:, , ,
Windows Platform Developers User Group meeting
06 October 10 10:45 PM | pavely | 3 comment(s)
This evening was a WPDUG meeting on CLR hosting and CLR profiling. Thank you all for coming! It was a pleasure to see so many of you there. My session was on CLR hosting, using the new CLR 4 hosting API. This is done using native code (C++) that uses COM for communication between the CLR and the host, both ways. I showed how to enumerate the installed runtimes, how to load a specific CLR (a new feature of CLR 4 – the ability to host multiple CLRs in a single process), how to create an application...
How To Be a Cool C++ Programmer / Developer
13 September 10 10:28 PM | pavely | 1 comment(s)
A few weeks ago I blogged about how to be a cool C# programmer. if you are a C++ programmer, you can be cool, too. The next C++ standard, dubbed C++0x promises many enhancements and cool abilities, but in this post I’ll stick with the current C++ standard. Here are some ways of being a cool C++ programmer (in no particular order): 1. Zeroing out a structure and setting its first field in one swoop One of the common needs in a native Windows applications is setting up structures in preparation for...
תגים:, , ,
More Posts Next page »