Microsoft KB Archive/273721

= BUG: COM Client Method Call Fails with ERROR_NOACCESS =

Article ID: 273721

Article Last Modified on 7/12/2001

-

APPLIES TO


 * Microsoft COM+ 2.0 Standard Edition

-



This article was previously published under Q273721



SYMPTOMS
If you use the Microsoft Interface Definition Language (MIDL) option /Oicg to generate the proxy stub code, the COM client's method call fails with ERROR_NOACCESS. You may also receive an Access Violation (0xC0000005) in the stub code. This happens only when you use the MIDL-generated proxy stub dynamic-link library (DLL) to marshal, and there is an empty interface (with no methods in it) in an interface hierarchy.

NOTE: This problem does not occur when the /Os flag is used to generate proxy stub code. However, /Oicf is the only option that supports certain new features of the MIDL compiler.



RESOLUTION
There are two ways to work around this problem:
 * Do not use an empty interface.
 * If possible, use the /Os flag for MIDL.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
  The IDL file should include the following code: ... typedef [unique] IBar* LPBAR; [   object, uuid(abcdef00-9f33-11cd-b23f-067534339cce), pointer_default(unique) ] interface IHello : IUnknown {   HRESULT Get([out] LPCAT* pCat); }

[   object, uuid(abcdef11-9f33-11cd-b23f-067534339cce) ] interface IMammal : IUnknown {   HRESULT DoSomething([in] BSTR pszString); }

[   object, uuid(abcdef22-9f33-11cd-b23f-056437769cce) ] interface ICat : IMammal {   //Empty interface with no methods in it. } ...                     The COM client should include the following code: ... LPBAR pBar = NULL; hr = pHello->Get(&pCat);

if(SUCCEEDED(hr)) {   hr = pCat->DoSomething(OLESTR(&quot;Bar&quot;)); } ... The above call to pCat->DoSomething fails with ERROR_NOACCESS. 

Additional query words: AV crash MIDL ERROR_NOACCESS 800003E6 0xC0000005

Keywords: kbbug kbpending KB273721

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.