Re: Exposing .Net events as COM events

Paul Schauble <[email protected]> Tue, 23 Jun 2009 11:35:56 -0700
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <C4F16ABFD2953540A2928DCF7972779902B58297@ELSCA-EXB-AV1.ticketmaster.corp>
This is the generated type library, minus the boilerplate at the
beginning. It looks correct to me.

    // Forward declare all types defined in this typelib
    dispinterface IPCIExternalEvents;

    [
      uuid(9FC477F2-612E-4D5F-ABF1-BB02CB5E82CF),
      version(1.0),
      custom(0F21F359-AB84-41E8-9A78-36D110E6D2F9,
PCIExtension.TestBarCodeReader.IPCIExternalEvents)    

    ]
    dispinterface IPCIExternalEvents {
        properties:
        methods:
            [id(0x00000001)]
            void PCIAction(
                            [in] long readerIndex, 
                            [in] long action, 
                            [in] BSTR message1, 
                            [in] BSTR message2);
    };

    [
      uuid(8609574E-2CCA-4D26-9403-EF6CACC14D48),
      version(1.0),
      custom(0F21F359-AB84-41E8-9A78-36D110E6D2F9,
PCIExtension.TestBarCodeReader.TestBarCodeReader)
    ]
    coclass TestBarCodeReader {
        interface _Object;
        [default] interface IPCIExternalDevice;
        [default, source] dispinterface IPCIExternalEvents;
    };
};

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[email protected]] On Behalf Of Patrick
Steele
Sent: Tuesday, June 23, 2009 5:34 AM
To: [email protected]
Subject: Re: [ADVANCED-DOTNET] Exposing .Net events as COM events

On Tue, Jun 23, 2009 at 2:37 AM, Paul Schauble <
[email protected]> wrote:

>
> Hopefully, someone can spot what I've done wrong. Any help would be
very
> much appreciated.
>
>
The code looks correct.  What does it look like in OLEView once you use
regasm to register the assembly?  Does your IPCIExternalEvents interface
show up as the default source interface for events?

-- 
Patrick Steele
http://weblogs.asp.net/psteele

===================================
View archives and manage your subscription(s) at
http://peach.ease.lsoft.com/archives
CONFIDENTIALITY NOTICE:

This message contains information which may be confidential or privileged.  If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited.  If you have received this transmission in error, please notify me immediately by telephone.

===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives