如何在此头文件中正确声明此函数?
CString ExecuteExternalProgram(CString pictureName);
#pragma warning( disable: 4049 ) /* more than 64k source lines */
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.h"
#include "rpcndr.h"
CString ExecuteExternalProgram(CString pictureName); //<---- THIS LINE IS ERROR?
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef __Example1_h__
#define __Example1_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifdef __cplusplus
extern "C"{
#endif
#ifndef __Example1_INTERFACE_DEFINED__
#define __Example1_INTERFACE_DEFINED__
void Output(
/* [string][in] */ const char *szOutput);
extern handle_t hExample1Binding;
extern RPC_IF_HANDLE Example1_v1_0_c_ifspec;
extern RPC_IF_HANDLE Example1_v1_0_s_ifspec;
#endif /* __Example1_INTERFACE_DEFINED__ */
#ifdef __cplusplus
}
#endif
#endif
答案 0 :(得分:1)
我在Visual Studio中创建了一个空项目,编译没有任何问题:
#include <atlstr.h>
#include "Example1.h" // Direct copy of your code from above
int main(int argc, char **argv) {
return 0;
}
我从http://www.codeguru.com/forum/showthread.php?t=231164了解了atlstr.h。
这是“正确”声明的意思吗?