I have a problem with Fire_Event that I can't figure out, and some help
would be appreciated. The "problem" is probably from my lack of
understanding of COM.

I have a server with three interfaces, one outbound event interface, and two
inbound interfaces


import "oaidl.idl";
import "ocidl.idl";

[    object,    oleautomation,    uuid(...),helpstring("The event
interface")    ]
interface IServerEvents : IUnknown {

    [id(10)]
    HRESULT RunState([in] BSTR app, [in] long state);


[object, oleautomation,uuid(...),helpstring("First inbound interface")    ]
interface Itest1 : IDispatch {
    [id(10), helpstring("Connect the system")]
    HRESULT connect([in] BSTR system);

    }

[    object,oleautomation,uuid(...),helpstring("second interface")]
interface Itest2 : IUnknown {

    [id(30)]
    HRESULT register([in] BSTR appname);

    };




/*------------ The library interface -------------*/

[
    uuid(...),
    version(1.0),
    helpstring("Test interfaceType library")
    ]
library interfaceLib
{
    importlib("stdole2.tlb");
    /*typedef enum deleted, not relevant here*/

    [
        uuid(...),
        helpstring("nterface class object")
    ]
        coclass testInterface {
        [default] interface ITest1;
        [default, source] interface IServerEvents;
        interface Itest2;
    };
};


----
The problem is that events fired from Itest2 methods (i.e using a Fire_Event
within the register method) is never propagated and never reaches clients
that are listening with ShowEvents, while events fired from Itest1 is. The
server is running as a local server, STA.

I have tried the following combinations on the server side:
self.Fire_Event(0, 'RunState', 'test', 3)
self.Fire_Event(...IServerEvents, 'RunState', 'test', 3)

Watching the debug output, I can see that the
.connectionpoints._call_sinks(...) is always executed when I call
Fire_Event(), but the object addresses of the ConnectionPointImpl object are
different depending on where the Fire_Event originates (from Itest1 or
Itest2)


-- 
      -e
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to