使用应用程序的Windows API commctrl.h在没有Platform SDK的机器上不起作用

Mik*_*kle 2 c++ windows dll

我写了一些使用以下内容的内容:

#include <math.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <commctrl.h>
Run Code Online (Sandbox Code Playgroud)

此代码在安装了Platform SDK的2台计算机上运行良好,但在干净安装的Windows(当然是VM)上不运行(既不是调试版本也不是发布版本).它很熟悉:

---------------------------
C:\Documents and Settings\Someone\Desktop\DesktopRearranger.exe
---------------------------
C:\Documents and Settings\Someone\Desktop\DesktopRearranger.exe

This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

---------------------------
OK   
---------------------------
Run Code Online (Sandbox Code Playgroud)

如何让它在干净的安装上运行?它找不到哪个dll?我的赌注是在commctrl上,但有人可以告诉我为什么不是每个窗口都没有?

更进一步,如果有人有关于如何调试这样的事情的提示,因为我的CPP已经生锈,因为它似乎:)

编辑 - 对我来说有用的是下载Redistributable for Visual Studio 2008.我不认为这是一个很好的解决方案 - 下载2MB文件并安装以运行一个简单的11K工具.我想我会更改代码以使用LoadLibrary从comctl32.dll获取我需要的2或3个函数.感谢大家 :)

Nic*_*ick 5

使用Dependency Walker.从http://www.dependencywalker.com/下载并安装(只需解压缩即可安装).然后加载您的可执行文件.该工具将突出显示缺少哪个DLL.然后,您可以找到您的可执行文件附带的可再发行包.

如果您使用VS2005,大多数情况将由http://www.microsoft.com/downloads/details.aspx?FamilyId=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en涵盖,其中包括运行使用VS2005创建的EXE所需的一切.但是,使用depends.exe可以找到更轻量级的解决方案.