MIDL 复杂类型作为接口方法参数

发布于 2024-09-07 23:04:56 字数 599 浏览 3 评论 0原文

我想知道是否有一些好的解决方案来处理无法导入 IDL 的复杂类型。我最关心的是使用 _m128 向量类型来模拟指令,即。 XMVECTOR。 midl 编译器无法识别 __declspec,因此不可能导入 __m128 数据类型。我研究过使用wire_marshal来执行此操作,但我认为它需要了解__m128类型的typedef。如果有一种方法可以让我foreword_declare XMVECTOR 与wire_marshal 一起使用,我对如何做到这一点一无所知。

我曾想过通过封装类型来隐藏类型,而我正在封装反射的数据类型。我在这里尝试了一些想法,包括从 COM 和 C++ 接口继承。这里看起来没有什么太有希望的。

很多人告诉我不要使用 COM,老实说,我花了很多时间没有编码,只是想弄清楚这些东西。我的逻辑一直认为使用 COM 有很多好处,而包括 MyCOM 在内的替代方案看起来同样耗时且充满问题。如果这是我使用 COM 时遇到的最大问题,我是否应该继续前言,或者解决方案是否会减慢该应用程序的速度,同时记住它对图形表示和实时计算建模的依赖?我正在考虑在渲染农场或云或类似的东西上做一些事情...我说得很大,我知道我是菜鸟,所以拜托,不要试图给人留下深刻的印象,只是想了解情况...我已经做了很多研究!

谢谢, 贝卡德:

I would like to know if maybe there are some good solutions to handling complex types not importable into IDL. My biggest concern is using _m128 vector types for simmed instructions ie. XMVECTOR. __declspec is not recognized by the midl compiler so importing the __m128 data type is out of the question. I looked into using wire_marshal to do this but I think it needs to be aware of the typedef of the __m128 type. If there is a way I can foreword_declare XMVECTOR for use with wire_marshal I haven't the foggiest on how I would do so.

I have thought of hiding the type by encapsulating it which it will already be being that I am encapsulating data types for Reflection. I have played around with a few ideas here including inheriting from both COM and C++ interfaces. Nothing here looked too promising.

A lot of people have told me not to use COM and I honestly have spent a lot of hours not coding and just trying to figure this stuff out. My logic keeps seeing a whole lot of benefits to using COM and the alternatives including MyCOM look just as time consuming and riddled with problems. If this is my biggest problem with using COM should I keep moving foreword or are the solutions going to slow down this application, keeping in mind its reliance on graphical presentation and real time computational modeling? I am looking into doing stuff on scale of rendering farms or clouds or something of the sort... I talk big and I know I am noob so please, not trying to impress just looking to become informed ... I have done a lot of research!

thx,
BekaD:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

征﹌骨岁月お 2024-09-14 23:04:56

在我嘴里留下了一点有趣的味道:\

typedef XMVECTOR* PTR_XMVECTOR;

typedef struct _ARRAY_XMVECTOR {
        unsigned int size_array;
        [size_is(size_array*SIZE_OF_XMVECTOR)] PTR_XMVECTOR VECTOR_ARRAY;
    } ARRAY_XMVECTOR;

typedef [wire_marshal(MARSHAL_AS)] ARRAY_XMVECTOR MY_VECTOR_ARRAY;

我会编辑它或将其添加为评论,但可能是该线程最接近的答案......可能是显而易见的......抱歉回答我的问题自己的问题:/

Leaves a bit of a funny taste in my mouth :\

typedef XMVECTOR* PTR_XMVECTOR;

typedef struct _ARRAY_XMVECTOR {
        unsigned int size_array;
        [size_is(size_array*SIZE_OF_XMVECTOR)] PTR_XMVECTOR VECTOR_ARRAY;
    } ARRAY_XMVECTOR;

typedef [wire_marshal(MARSHAL_AS)] ARRAY_XMVECTOR MY_VECTOR_ARRAY;

I would have edited it in or added it as a comment but probably the closest this thread will come to an answer... probably the obvious one .... sorry for answering my own question :/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文