grab our rss feed

stevienova.com

Homepage of Steve Novoselac

Entries Tagged ‘CPlusPlus’

Why is MFC Not Dead?

I was reading through some blogs this morning, and ran across this one, from my MSDN Feed.
Here is my answer (I wanted to leave a comment, but it wasn’t working, and I figured it would be a good blog post anyways)
Right now you can make an MFC app and it can run on win98,2k,xp,vista, [...]

Comments (8) | 2,141 views

Installing Fonts Programmatically on Windows

Working on a project, I came across the need to install a font on a machine. Now, manually, you can just right click on the font->install. Or I am pretty sure you can just copy into %windir%\fonts\ and it then it works, but it might not be usable until you reboot, I am not a [...]

Comments (3) | 407 views

TFS Team Build, TFSBuild.props and Visual C++

Team Foundation Server is a pretty sweet setup. It integrates source control into the Visual Studio IDE, and makes it easy for teams to work on projects together. With a little tweaking you can set up Continuous Integration and nightly builds. There are many different ways to set up your project layouts and references, which [...]

Leave a Comment | 179 views

Visual Studio 2005 - C++ Unit Testing - Not so good

So, as of late, I have been programming more in C++ than in C#/.NET. The first order of business was getting everything to Visual Studio 2005, which has been accomplished. In .NET, there is built in Unit Testing, Code Coverage, Refactoring, etc. In Visual Studio C++ unmanaged/native C++, you don’t get any of that. (Thanks [...]

Leave a Comment | 284 views

C++ OutputDebugString()

I have programmed in many different languages, and as much as I can remember, one of the best things you can do is write debug ouput to an output window
VB 6.0 - Debug.Print “Debug Output”
.NET - System.Diagnostics.Debug.WriteLine(”Debug Output”);
and recently I have been doing some VC++ programming, and I didn’t know how to output to the [...]

Comments (1) | 139 views

First-chance exception at 0×7c812a5b in : Microsoft C++ exception: CError at memory location

If you are programming and you have some calls to ShellExceute in your code, and you are debugging, you might see this fly across the output window
First-chance exception at 0×7c812a5b in : Microsoft C++ exception: CError at memory location
The app will be your exe name, and location will be a memory location.
You can reproduce [...]

Comments (3) | 392 views

C++ - Release Your Buffers

I am in the process of taking some 3rd party c++ source code, and converting it to VS2005. One thing I noticed over and over, is that when you are reading in file contents, you need to make sure to release the buffer, but with the length of the file as the parameter.
For example, this [...]

Leave a Comment | 101 views

fatal error CVT1100: duplicate resource.

More C++ gotchas. You get this error, what do you do?
Check your resource file, there is a resource with an ID of 1. Change it to something (5000) or whatever, and rebuild. You should be good to go.

Leave a Comment | 577 views

error C2440: ’static_cast’ : cannot convert from ‘UINT (__thiscall CStaticLink::* )(CPoint)’ to ‘LRESULT (__thiscall CWnd::* )(CPoint)’

If you are updating from VS2003 to VS2005, C++, you might run across an error like this. What it means is that they changes the return types from 2003 to 2005. You just need to change the UINT to an LRESULT and you should be good to go.

Leave a Comment | 668 views

LNK1104: cannot open file ‘LIBC.lib’

If upgrading a C++ project from VS2003 to VS2005, you might run into this error. LNK1104: cannot open file ‘LIBC.lib’
I resolved it by doing the following:
Project->Properties->Configuration Properties->Linker->Input
Ignore Specific Library: libc.lib
I guess VS2003 has there by default, from what I have been reading.

Leave a Comment | 966 views