Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Midl Bug with 'call_as'

101 views
Skip to first unread message

Brian R.

unread,
Jun 26, 2006, 1:18:02 PM6/26/06
to
I am trying to use IStorage in .NET and the type library that I am importing
the interface definitions from contains a description of OpenStream as
RemoteOpenStream. Using OleView shows that the type lib was constructed with
the RemoteOpenSream method definition instead of the local OpenStream.

I read a short FAQ on the internet that stated that there was a bug in the
MIDL tool and that it incorporates the 'call_as' method instead of the
'local'. Given this, is there a midl option that would force it to pull in
the 'local' version?

I am trying to use the IStorage::RemoteOpenStream and it is failing on me.
I cannot get it to work without an exception. I am able to get
IStream::RemoteRead and RemoteWrite to work.

Any help would be greatly appreciated!
--
Brian R.

Alexander Nickolov

unread,
Jun 26, 2006, 1:45:58 PM6/26/06
to
I wouldn't call it a bug. Simply a type library cannot represent
interfaces with [local]/[call_as] method pairs. This is advanced
IDL well beyond the limited capabilities of a type library...

Your first mistake, however, is putting a standard interface in
a type library. This is _strictly_prohibited_.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnic...@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

"Brian R." <8B2H4R_...@noemail.nospam> wrote in message
news:18EB1AB7-BA44-4419...@microsoft.com...

Brian R.

unread,
Jun 27, 2006, 12:56:02 PM6/27/06
to
I would agree thtat is it undesirable to pull in a standard interface, but we
are having to deal with the fact that .NET has not provided a definition of
the IStorage interface in teh System.Runtime.InteropServices namespace like
it has for UCOMIStream.

As I see it the IStorage interface is a COM interface that provides an IDL
and a .H file, but no type library. To utilize this interface through COM
Interop from .NET, the description needs to be incorporated into .NET and a
type library is one of the most obvious ways given the IDL definitions and
ability to incorporate as is in type library or a C++ component that
implements IStorage.


--
Brian R.

Alexander Nickolov

unread,
Jun 28, 2006, 1:01:59 AM6/28/06
to
I believe a type library is not mandatory for COM Interop.
Ask in the interop group on how to adapt a non-Automation
interface (that can't be represented in a type library):

microsoft.public.dotnet.framework.interop

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnic...@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

"Brian R." <8B2H4R_...@noemail.nospam> wrote in message

news:AA40DA62-D573-4875...@microsoft.com...

0 new messages