This is a very common compiler error with the C++ applications using the /clr switch. Here is the compiler output
错误 2 error C3699: “*”: 不能在类型“IServiceProvider”上使用此间接寻址 c:/program files/microsoft sdks/windows/v6.0a/include/servprov.h 96 ViComAPIBridgeDLL
错误 3 error C2371: “IServiceProvider”: 重定义;不同的基类型 c:/program files/microsoft sdks/windows/v6.0a/include/servprov.h 103 ViComAPIBridgeDLL
... ... ...
错误 8 error C2872: “IServiceProvider”: 不明确的符号 C:/Program Files/Microsoft SDKs/Windows/v6.0A/include/urlmon.h 5856 ViComAPIBridgeDLL
The problem is the
#include <windows.h>
using namespace System;
directives. The first one is in conflict with the second.
To resolve the error, just swap their places like that
using namespace System;
#include <windows.h>