C# к событиям VB6 COM (“объект или класс не поддерживает набор событий”),

К сожалению, да, для Ubuntu они легко доступны, но для RHEL 4 и 5 я почти всегда заканчивал тем, что делал их из тарболлов. Это отличные библиотеки, просто очень большие ... как, например, использование шипа для рельса, когда иногда все, что вам действительно нужно, - это канцелярская кнопка.

5
задан EMon 19 May 2009 в 06:58
поделиться

2 ответа

I was defining the interface using the delegate instead of the event:

/* Externally Accesssible Event API */
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface ISerialEvent
{
    [DispId(5)]
    void DataEvent();
}

should be

/* Externally Accesssible Event API */
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface ISerialEvent
{
    [DispId(5)]
    void dEvent();
}
4
ответ дан 13 December 2019 в 19:34
поделиться

Look at this article here.

Specifically it looks like you missing a declaration that looks something like this.

[Guid("9E5E5FB2-219D-4ee7-AB27-E4DBED8E123E"),
    ClassInterface(ClassInterfaceType.None),
    ComSourceInterfaces(typeof(DBCOM_Events))]
    public class DBCOM_Class : DBCOM_Interface
    {

You have this part

// // Events interface Database_COMObjectEvents 
[Guid("47C976E0-C208-4740-AC42-41212D3C34F0"), 
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface DBCOM_Events 
{
}

But without the second the vtable and typelib of the COM object doesn't have the Event Maps needed to work with VB6 (or other COM Consumers).

You can use the Google search terms "com event" c# and get a bunch of other good results.

7
ответ дан 13 December 2019 в 19:34
поделиться
Другие вопросы по тегам:

Похожие вопросы: