Thursday, December 1st, 2005

undname.exe

Undname.exe is a really neat little tool that comes with Visual Studio, helpful in tracking down odd link issues when build settings for projects are just a little off. I had a DLL project (Codejock’s Toolkit Pro) that was having some linking problems with my MFC application. So I dug out one of the decorated names my app was looking for, and used depends.exe to view the decorated names in the Codejock DLL.

app: ?OnDocumentComplete@CXTHtmlView@@UAEXPBG@Z
lib: ?OnDocumentComplete@CXTHtmlView@@UAEXPB_W@Z

Just slightly off. undname.exe gave me the corresponding method declaration:

Microsoft (R) C++ Name Undecorator
Copyright (C) Microsoft Corporation 1981-2001. All rights reserved.

Undecoration of :- "?OnDocumentComplete@CXTHtmlView@@UAEXPB_W@Z"

public: virtual void __thiscall CXTHtmlView::OnDocumentComplete(wchar_t const *)

Microsoft (R) C++ Name Undecorator
Copyright (C) Microsoft Corporation 1981-2001. All rights reserved.

Undecoration of :- "?OnDocumentComplete@CXTHtmlView@@UAEXPBG@Z"

public: virtual void __thiscall CXTHtmlView::OnDocumentComplete(unsigned short const *)
Turns out Codejock’s MSVC 7.0 project had the “Treat wchar_t as a built-in type” set to Yes, but my app had it set to No. Neat trick.

Posted by Jim Mathies on December 1st, 2005 | Filed in Software | Comment now »



Please leave a Comment