activex events between apartments


environment: vs2008 (atl), borland developer studio 2006.



hello all. i'm carrying troubles activex control events.



here brief outline app architecture:



there an inproc com server contains sta activex control (aka control) mta com vigilant (aka object).



here idl construction control vigilant interfaces:



[
object,
uuid(2338ccaf-bbaf-4e29-929b-a67285b1e772),
dual,
nonextensible,
pointer_default(unique)
]
interface iobject : idispatch{
[id(1)] hresult dowork(void);
};

[
object,
uuid(1a0a1da2-e33b-4df4-99a9-9eaef2281e7d),
dual,
nonextensible,
pointer_default(unique)
]
interface icontrol : idispatch{
};


[
uuid(bc27fabd-2794-4f9c-b3bd-c0c0628741fa),
version(1.0),
helpstring("avrep 1.0 form library")
]

library activexlib
{
importlib("stdole2.tlb");
[
uuid(4b5575a7-e0ff-49b5-ae10-0d980cf49eb3)
]
dispinterface _icontrolevents
{
properties:
methods:
[id(1)] hresult someevent([in] iobject* obj);
};
[
uuid(7c44f19e-6b71-434b-96f6-e29a3c66c794),
control
]
coclass control
{
[default] interface icontrol;
[default, source] dispinterface _icontrolevents;
};
[
uuid(17bdfac0-df21-4474-bcff-846fe0075d68)
]
coclass object
{
[default] interface iobject;
};
};


client delphi concentration activex control form creates mta vigilant calls the dowork method



var
mta : iobject;
begin
mta := createoleobject('activexlib.object.1') iobject;
mta.dowork();
end;


this slight directly calls fire_someevent slight activex control coclass passes 'this' parameter (pointer iobject interface). delphi formula successfully receives eventuality nonetheless tries opening any iobject slight ability (not shown idl simplicity) following opening defilement occured oleaut32.dll.



one vicious note - i atlcpimplmt category exercise eventuality banishment opposite threads (see details). doing allows switch apartments eventuality fires (from mta unit vigilant sta delphi forms apartment). i advise problem associated crude eventuality parameter marshaling since customary atlcpimpl category used works fine.



are there any restrictions cross-apartment events? maybe special delphi sourroundings setup mandatory work activex objects correctly...



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?