我有一个idl,它包含一个简单的接口定义:
library DecoToniCfgLib
{
importlib("stdole32.tlb");
//....code
//....code
[
object,
uuid(A6F30650-53F5-4688-829A-C084BA1C7DC0),
dual,
nonextensible,
helpstring("DecoToniConfig Interface"),
pointer_default(unique)
]
interface IDecoToniConfig : IDispatch
{
[id(1), helpstring("Opens the Tones config and returns the params")]
HRESULT OpenToneConfigWindow([out, retval] TCodecParams* pVal);
[id(2), helpstring("Opens the Tones config and returns the params in an array form")]
HRESULT OpenToneConfigWindowArray([out, retval] SAFEARRAY(float)* pVal);
[id(3), helpstring("Opens the masks config window")]
HRESULT OpenMaskConfigWindow([out, retval] SAFEARRAY(TMask)* pVal);
};
}我向它添加了一个返回SAFEARRAY(浮点数)的方法,但是当我运行TlbImp为托管代码创建导入库时,我得到:
TlbImp : error TI1036 : Cannot find 'System.Single[] OpenToneConfigWindowArray()'
in 'DecoToniCfgLib.IDecoToniConfig' when implementing 'DecoToniCfgLib.IDecoToniConfig'
in 'interop.DecoToniConfigLib.DecoToniConfigClass'
from 'interop.DecoToniConfigLib, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'.问题在哪里?
也许我得参考点什么?如果so...how能帮上忙的话?
致以问候。
发布于 2014-06-10 07:05:13
当我跑的时候
tlbimp.exe DecoToniConfigLib.dll /out:interop.DecoToniConfigLib.dll它创建两个文件: DecoToniCfgLib.dll (定义为IDL的库)和interop.DecoToniConfigLib.dll
@hans注释在我的脑海中点亮了一盏灯,我在运行tlbimp again...and之前删除了这两个文件。
https://stackoverflow.com/questions/24084965
复制相似问题