我最近才开始与 DLLS 合作。 虽然我已经在 Linux 上做了一些严重的 C++ 程序, 并且知道 DLLS 是什么 。 我需要使用自定义动作编码一个窗口安装器 。 为此我在2010年视觉工作室新建了一个 DLL 项目 。 当我试图将 msi.h 包含在 StdAfx.h 文件里时, 我就会发现错误 :
1>------ Build started: Project: CustomAction, Configuration: Debug Win32 ------
1> DllEntry.cpp
1>c:program files (x86)microsoft sdkswindowsv7.0aincludemsi.h(86): error C2146: syntax error : missing ; before identifier WINAPI
1>c:program files (x86)microsoft sdkswindowsv7.0aincludemsi.h(86): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:program files (x86)microsoft sdkswindowsv7.0aincludemsi.h(86): error C2146: syntax error : missing ; before identifier MsiCloseHandle
1>c:program files (x86)microsoft sdkswindowsv7.0aincludemsi.h(86): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
......................
此工程除了 StdAfx. cpp 外, 没有任何其它东西, 其中包括 StdAfx 信头和 StdAfx.h 文件, 即 :
#include <msi.h>
#include <msiquery.h>
#include <stdio.h>
I tried adding path to the msi.lib in the linker input properties of the project. It didn t work. I also tried adding path to the lib folder, include folder and bin folder of the windows sdk directory, that also didn t work. What is the cause for this and also if anyone can give me pointers to any tutorial to using custom actions with windows installers as I am a newbie in this area.