Cluebat-man to the rescue

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

Browse by Tags

All Tags » cplusplus (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...
Practical ATL: recognizing marshalling problems
Before I publish my next article, I should explain something else about the black magic aspect of ATL / COM: Marshalling. The Stuff server we made in the previous article is an out-of-proc server. This means that the arguments being passed to / from a...
File a bug report and make Visual Studio a better product
If you find a bug in Visual Studio, report it on http://connect.microsoft.com If the bug affects the version of VS that is in development at that time, there is a significant chance it will get fixed before the next release. Just this week I got confirmation...
Practical ATL: Implementing an enumerator object
This is my first article about practical ATL examples, which I already mentioned here. In this example I will create an ATL Server which implements 1 custom interface: IStuff. Hardly an inspiring name, but I couldn’t think of anything better before...
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...
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: ,
Creating a thread safe producer consumer queue in C++ without using locks
Yesterday, someone in the newsgroups asked a question about synchronization problems he was having. I explained that –if properly programmed– a consumer producer queue does not need synchronization even on a multiprocessor machine. A Microsoft...
Posted: Jan 05 2007, 03:11 AM by vanDooren | with 30 comment(s)
Filed under: ,
Fun with templates: implementing policy based error handling
This article is a follow up of my third article on interoperability for LabVIEW arrays in C++. That article provided a method for allowing programmers to index into multi dimensional arrays. As far as functionality went, the solution was OK, but the error...
Posted: Oct 02 2006, 03:01 AM by vanDooren | with no comments
Filed under: ,
Differences between C# and C++/CLI, part 2
One question that comes up from time to time in the C++ newsgroups is that functions or constants that exist in a C++/CLI class library are not accessible in a C# or VB.NET project. The reason for this is nearly always that that constants or functions...
Posted: Aug 31 2006, 03:58 PM by vanDooren | with 1 comment(s)
Filed under: , ,
Differences between C# and C++/CLI, part 1
Learning C# if you already know C++ is relatively easy. The syntax is similar, and the semantics are definitely a lot easier to understand. Since C# looks like C++, most of the concepts are easy to learn, but here and there are a few details that might...
Posted: Aug 31 2006, 03:56 PM by vanDooren | with 2 comment(s)
Filed under: , ,
Fun with template classes: Manipulating LabVIEW arrays in C++, part 3
This article is a follow up of my second article on interoperability for LabVIEW arrays in C++. That article provided a method for allowing programmers to index into multi dimensional arrays like this: But that solution was a bit clunky. It involved 4...
Yet another contribution to the VCFAQ
Did you ever encounter problems to do with the size of structures in C or C++? In that case, chances are that you had to deal with structure layout and byte packing. You can read my explanation over here .
Posted: Aug 01 2006, 03:43 PM by vanDooren | with no comments
Filed under: , ,
The joy of receiving an MVP award
Yaaaaaaay. Yesterday I received a message to tell me that I received the Microsoft MVP award in the category 'Visual C++'. I knew I was nominated 2 months ago, which I found very cool. Of course I had to wait a bit because the anouncement of the...
Posted: Jul 04 2006, 03:39 PM by vanDooren | with no comments
Filed under: , ,
Another contribution to the VCFAC
My second contribution to the VCFAQ is now online. It discusses 3 common causes of segmentation faults after upgrading a project to a newer version of Visual C++. You can read it over here: http://vcfaq.mvps.org/lang/9.htm
Posted: Jun 18 2006, 03:30 PM by vanDooren | with no comments
Filed under: , ,
Is it possible to create (USB) device drivers with Visual C++?
This question pops up in the Visual C++ newsgroups from time to time. You can’t. At least, you cannot directly perform USB communications. USB simply doesn’t work that way. They same is true for PCI, Firewire, SCSI, ... All USB IO has to be...
More Posts Next page »