MIDL“内部编译器问题"(Internal Compiler problem)试图导入带有SAFEARRAY的结构 [英] MIDL "internal compiler problem" trying to importlib a struct with a SAFEARRAY

查看:300
本文介绍了MIDL“内部编译器问题"(Internal Compiler problem)试图导入带有SAFEARRAY的结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个容易重复的内部编译器问题,我找不到解决方法.如果我创建一个简单的类型库来保存所有数据类型:

I have an easily repeatable internal compiler problem that I can't find a workaround for.  If I create a simple type library to hold all of my data types:

//伪IDL代码

库DataTypeLib

library DataTypeLib

{

struct MyStruct

  struct MyStruct

{

int field1;

    int field1;

SAFEARRAY(BSTR)字段2;

    SAFEARRAY(BSTR) field2; 

};

};

然后我可以毫无问题地将其编译为tlb文件.然后,我创建一个IDL,该IDL在该tlb上调用importlib并定义一个使用该结构的接口:

Then I can compile that into a tlb file with no troubles.  Then I create an idl that calls importlib on that tlb and defines an interface that uses that structure:

接口IMyInterface

interface IMyInterface

{

HRESULT MyFunction([in] MyStruct *输入);

  HRESULT MyFunction( [in] MyStruct* input );

};

importlib("DataTypeLib.tlb");

importlib("DataTypeLib.tlb");

我得到以下信息:

1> midl:错误MIDL9008:内部编译器问题-请参阅文档,以获取有关如何找到解决方法的建议.

1>midl : error MIDL9008 : internal compiler problem - See documentation for suggestions on how to find a workaround.

1> midl:断言失败:0,文件z:\ nt \ com \ rpc \ midl \ codegen \ ndrcls.hxx,第492行

1>midl: Assertion failed: 0, file z:\nt\com\rpc\midl\codegen\ndrcls.hxx, line 492

我对ndcrls.hxx文件的所有搜索均未发现任何结果.到目前为止,我只能想出的唯一解决方法是在MyStruct中不要使用SAFEARRAY,但这并不是什么解决方法.其他人有没有走过这个运气吗?

All of my searches for that ndcrls.hxx file turned up nothing.  The only workaround I can come up with so far is not to have a SAFEARRAY in MyStruct, but that isn't much of a workaround.  Anyone else had any luck in getting past this one?

推荐答案

您可能不应该找到ndcrls.hxx文件.这些数据可能供Microsoft使用.您需要查找的是MIDL9008,但这可能也无济于事.请参阅编译器错误.我认为该信息具有误导性;文档中可能没有任何解决方法.您需要搜索错误报告以查找有关该问题的先前报告;可能是您使用信息断言失败"的地方. ...."ndrcls.hxx,第492行".

You probably are not supposed to find the ndcrls.hxx file. That data is probably for Microsoft to use. The thing you need to look up is MIDL9008, but that probably does not help for this either; see Compiler Errors. I think the message is misleading; there are probably not any workarounds in the documentation. You need to search bug reports to look for previous reports of this problem; probably that is where you use the information "Assertion failed" .... "ndrcls.hxx, line 492".

我不确定在哪里可以找到以前的错误报告或报告错误;可能 https://connect.microsoft.com/VisualStudio .我在这里搜索,但没有找到ndrcls或MIDL9008,因此您可以尝试在此处提交新的错误报告.也许这里经验更丰富的人之一会提供更多帮助.

I am not sure where to look for previous reports of bugs or to report a bug; probably https://connect.microsoft.com/VisualStudio. I searched in there and found nothing for ndrcls or MIDL9008, so you can try submitting a new bug report there. Perhaps one of the more experienced people here will help more.


这篇关于MIDL“内部编译器问题"(Internal Compiler problem)试图导入带有SAFEARRAY的结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆