ODL文件有帮助吗? [英] ODL File help please?

查看:75
本文介绍了ODL文件有帮助吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个COM服务器,需要在同一进程空间中与另一个COM服务器进行通讯.
我正在使用ROT设置对另一个COM服务器实例的访问权限,但遇到了我需要调用的唯一函数的一些未解决的外部问题.有人建议我导入一个tlb,以向编译器提供必要的信息,这样我就不用再编写一个可以编译为所需tlb的ODL文件了.

Class对象是Cbcrshimcontrol
我需要调用的成员函数是,静态无效MidiOutFromMaster(DWORD)

我制作了一个ODL并对其进行编辑以满足我的需求,但是在成员函数方面有一段时间让MIDL编译器满意.我正在寻找
当我用google搜索它时,没有太多信息,所有尝试定义该函数的尝试都会产生:

错误MIDL2349:无效成员:MidiOutFromMaster [库''Cbcrshimcontrol''

这是到目前为止我的小ODL文件.

I have COM server that needs to talk to another COM server in the same process space.
I am using the ROT to setup access to the other COM server instance but suffered some unresolved externals for the one and only function I need to call. It was suggested that I import a tlb to supply the compiler with the necessary information so not having one I set off to make an ODL file that I could compile to the needed tlb.

The Class object is Cbcrshimcontrol
The member function I need to call is, static void MidiOutFromMaster(DWORD)

I made an ODL and am editing it to hopefully suit my needs but am having a time satisfying the MIDL compiler with respect to the member function. I am finding
not very much info when I google for it and all attempts to define the function produce:

error MIDL2349 : invalid member : MidiOutFromMaster [ Library ''Cbcrshimcontrol''

Here is my little ODL file so far.

// oditest.odl : type library source for oditest.dll
// This file will be processed by the MIDL compiler to produce the
// type library (oditest.tlb).
[ uuid(F3120704-CF1B-4B96-AF60-B8610FEC4783), version(1.0) ]
library Cbcrshimcontrol
{
    importlib("stdole32.tlb");
    importlib("stdole2.tlb");
    static void MidiOutFromMaster(DWORD);
};



谢谢.

:Ron



Thank you.

:Ron

推荐答案

,您必须声明暴露该方法的接口(MidiOut ...),然后将该接口包含在库中的暴露该coclass中它

像...

you have to declare the interface that exposes that method (MidiOut...), and then include that interface in the library, within a coclass that exposes it

something like ...

[
    object,
    uuid(<your itf GUID in here>),
    oleautomation,
    nonextensible,
    pointer_default(unique)
]
interface IyourMIDIinterface : IUnknown{

HRESULT MidiOutFromMaster([in] DWORD);

};
[
    uuid(F3120704-CF1B-4B96-AF60-B8610FEC4783),
    version(1.0),
]
library CbcrshimcontrolLib
{
    importlib("stdole2.tlb");

    [
        uuid(<your control lib guid>)
    ]
    coclass Cbcrshimcontrol
    {
        [default] interface IyourMIDIinterface;
    };



但是,这应该都是多余的-如果您已经获得了从COM对象的源,并且它是一个真实 COM对象(即通过MFC创建的)或ATL向导),您应该在某个地方使用类型库...

您是如何创建从属com对象的?



However, this should all be redundant - if you''ve got the source to the slave COM object, and it''s a real COM object (i.e. created via an MFC or ATL wizard) you should have a type library kicking around somewhere ...

How did you create the slave com object?


这篇关于ODL文件有帮助吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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