Is this ATL-wizard-created IDL that you've modified?  What version of VC++
were these components created in?

If I remember correctly, ATL-generated interfaces are dual (at least
created in VC6 and greater), and it uses IDispatch by default for VB6 (or
5? and older versions of "automation" support in VC++).  Unless it thinks
one or more of your properties/parameters is not a native COM type, I
think.

>From a COM interop. perspective, it really has no bearing; as long as your
server is implementing that interface you've changed to from IDispatch--
which, obviously it is or you'd have no success at all.  If you have
implemented your COM interfaces through ATL, it's more of an ATL issue;
so, your question may be falling on deaf ears in these forums.

You'll also have to make sure you're not aggregating the IServer
interface, or planning to.  You most likely would have run into a problem
if you were aggregating that interface, because you can't cast from
IDispatch to IServer and expect to get the right vtable with aggregation--
which is what would be happening (essentially casting) if you've only
changed the IDL.  Even if you're not aggregating the interface you may
want to change your propget implementation to query the new interface
instead of IDispatch.  For example, you may have implemented
get_AdvancedSearch as "get_AdvancedServer(IDispatch ** pVal)" where the
interface is retrieved with "return m_pAdvancedServer->QueryInterface
(pVal);".  You may want to change the prototype to "get_AdvancedServer
(IServer ** pVal)" nonetheless.

If your IDL change causes your COM server not to release, then you've
introduced a problem (if it released before--you'd be surprised how many
COM servers don't release properly).  I don't know what the logic is like
with .NET COM interop and releasing COM objects and garbage collection.  I
imagine it's not immediate and there may be no way to get to be immediate
without Dispose.

http://www.peterRitchie.com/Blog/

On Sun, 5 Mar 2006 01:04:06 -0500, Josh Gough <[EMAIL PROTECTED]>
wrote:

summarized: Is it safe to change IDispatch to IServer in the IDL for a
VC++ COM component with COM interop?

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to