Cluebat-man to the rescue

A weblog dedicated to Visual C++, interoperability and other stuff.

Browse by Tags

All Tags » C++ (RSS)
Practical ATL: Solving the race condition in CAtlExeModuleT
When I was spelunking through the ATL header for my previous articles (the class object plumbing) I discovered that there is a serious race condition in the server lifetime management. I contacted the Microsoft C++ folks, and someone from the libraries...
Practial ATL: Implementing a non-standard class object
In my previous article in this series, I explained how class objects are associated with COM objects, and how it all fits together. Armed with that knowledge, I can now demonstrate how to provide a custom class object that will allow us to support parameterized...
Practical ATL: Understanding the class object
In my previous article in this series, I explained how to create a simple COM server and implement a method that returns an enumerator object. It was all done very easily, but the ATL wizards hide some of the things that you really ought to know for my...
Getting started with ATL
I am currently working on some projects where I have to program a DCOM server. There are several reasons why it has to be DCOM and C++, instead of e.g. .NET remoting and C#. The biggest pain (imo) about DCOM is that the technology stems from an era when...
Found an interesting bug in the Visual Studio IDE
I know, I know, ... .NET is all the rage, and DCOM is legacy technology, best not touched by up and coming programmers with good hair and sharp look, lest they appear 'uncool' or even worse: 'obsolete'. But some of us still use DCOM for...
Backing up event logs in their normal binary format
Some time ago I was looking for a way to make backups of the eventlogs of our server, preferably without me ever having to do anything anymore J This was not success. There are a couple of tools to make text exports from eventlogs. These have the disadvantage...
Interesting blog post on the VC blog
http://blogs.msdn.com/vcblog/archive/2008/10/28/lambdas-auto-and-static-assert-c-0x-features-in-vc10-part-1.aspx Stephan blogs about new stuff in the upcoming C++ 0x standard. It's quite length, but well worth a read.
Posted: Oct 30 2008, 06:09 AM by vanDooren | with no comments
Filed under:
Small bug in the MSDN documentation
Hardly worth mentioning, but there is a minor bug in the documentation of fopen and its friends. The remarks section lists the open mode encoding for 16 bit unicode as UTF16-LE instead of UTF-16LE. As I said it is very minor, but if you use fopen, care...
Posted: Oct 09 2008, 01:02 AM by vanDooren | with no comments
Filed under: ,
How not to ask question on a forum
Here is another person who needs to learn some netiquette (emphasis mine). Hey, well, I will not describe my situation because it is not part of my question and has nothing directly to do with it and would only lead to false assumptions as it already...
Posted: Oct 06 2008, 01:29 AM by vanDooren | with no comments
Filed under: ,
Programmer discovers that floating point numbers have a floating point
I hang out in the MSDN forums on a regular basis, to see if there’re any questions that need answering. Usualy this is pretty unexciting, but every now and again, the asker really needs a reality check. This thread came up some time ago, and it...
Posted: Oct 02 2008, 12:05 AM by vanDooren | with 1 comment(s)
Filed under: ,
My latest article in NTInsider
A bit late perhaps, but my latest article on API development got published in the NTInsider (owned by OSR Online ). The online version can be found here . It requires free registration. I know that at least 2 people have read it completely, because that...
C++ keyword of the day: export
The export keyword is a bit like the Higgs boson of C++. Theoretically it exists, it is described by the standard, and noone has seen it in the wild. :) Before I get flamed to hell and back: that last part is not entirely true. There is 1 C++ compiler...
References in C++ are not necessarily safe
People who are new to C++ sometimes have the mistaken idea that using references instead of pointers makes your code safe. People who have been programming a bit longer know this is anything but the case. References are just semantic sugar coated pointers...
Posted: Sep 17 2008, 07:46 AM by vanDooren | with 1 comment(s)
Filed under:
How DLL exports really work
I found this list of article on Raymond's blog . Raymond's blog is one of the more interesting for programmers who use native APIs because he often touchs on things that are not documented, but interesting to know if you care about how things...
Stuck on stupid
It happens to every programmer. It doesn't happen often, but it does happen to everyone. You are looking at a piece of code or some debugging output, scratching your head and thinking 'This is impossible'. It's probably only 10 or 20 lines...
Posted: Sep 10 2008, 03:31 PM by vanDooren | with no comments
Filed under: ,
Regex bug in VC2008 SP1 TR1 library
Yesterday I tracked down a bug in the TR1 regex library that is shipped with VS2008 SP1. If you use regexes, then the regex a| will cause an exception to be thrown because of supposedly illegal syntax. For example you could use (a|) in a regular expression...
Posted: Sep 04 2008, 04:46 AM by vanDooren | with no comments
Filed under:
Extending a native C++ project with managed code
One question that comes up from time to time in the newsgroups is ‘I have a native C++ project and I want to extend it with Managed code (e.g. Windows Forms). What do I do?’ The answer is not so complex. It is fairly easy to extend native...
Fun with templates: parsing command line arguments
One of the things that everyone has to do sooner or later is parsing command line arguments into program variables. Even the most trivial command line application needs some input variables to tell it what to do. One of the things in which C and C++ are...
Posted: Aug 14 2008, 05:17 AM by vanDooren | with no comments
Filed under: ,
VC2008 feature pack released
http://blogs.msdn.com/vcblog/archive/2008/04/07/visual-c-2008-feature-pack-released.aspx Finally we get TR1 with VC2008. Get it while it's hot. This allows me to move a codebase to VC2008 and removing the dependency on boost.
Posted: Apr 08 2008, 03:50 PM by vanDooren | with no comments
Filed under:
Differences between C++ and C#, part 3
One of the things that C# (and VB.NET) programmers have to live with is non-deterministic destruction of their objects. The garbage collector was introduced in .NET to take care of memory leaks and remove the need for manual memory management. It does...
Posted: Feb 27 2008, 05:52 AM by vanDooren | with no comments
Filed under: ,
More Posts Next page »