Re: IDL to C#?

From: Leon_Amirreza (r_rahmaty_at_hotmail.com)
Date: 07/16/04


Date: Fri, 16 Jul 2004 19:58:11 +0430

i added the library {} and command line switches documented in msdn to
generate tbl ; but many attributes used in the oleidl.idl cant be parsed be
midl.exe .
i faced many error messages i dont know was it because i used midl in the
wrong way or what?

"Mattias Sjögren" <mattias.dont.want.spam@mvps.org> wrote in message
news:uj#neZxaEHA.752@TK2MSFTNGP09.phx.gbl...
>
> >Is there any tool that can convert and Interface definitions (especially
> >oleidl.idl) to C# interface definitions?
> >does MIDL.exe do that? i could just get c++ header files.
>
> MIDL and TlbImp is the way to go. But for MIDL to produce a typelib I
> belive you need a library {} block in the IDL file, which is missing
> in Oleidl.idl.
>
> But for non automation interfaces like those in Oleidl.idl, the IA
> produced by Tlbimp isn't always perfect, and you may have to modify it
> to make it really usable. So it's often easier to write your own COM
> interface declarations directly in C# instead. You can find examples
> of that in the .NET SDK directory
> Samples\Technologies\Interop\Applications\ShellCmd
>
>
>
> Mattias
>
> --
> Mattias Sjögren [MVP] mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.



Relevant Pages

  • Re: IDL to C#?
    ... MIDL and TlbImp is the way to go. ... But for MIDL to produce a typelib I ... interface declarations directly in C# instead. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SAFEARRAY(Interface)
    ... This method definition is clearly not automation-compliant. ... So it means that a custom proxy-stub must be generated by the MIDL ... Out of the box, if you try to define the above COM interface method, the MIDL compiler give a warning message: ... If so, I'm speculating that this COM object's interface was designed not to be marshaled at all, and therefore the COM ...
    (microsoft.public.win32.programmer.ole)
  • Re: MarshalAs for Properties?
    ... generate by TLBIMP. ... MarshalAs attribute for the value parameter of the C# set accessor. ... definition of your interface. ... > When I'm doing Method mapping I can pass a parameter and ...
    (microsoft.public.dotnet.framework.interop)
  • Benutzung von Datentypen aus COM-Dlls
    ... Unser Kunde hat eine Typenbiliotek von der ich ... Wenn ich aber das Interface als parameter meiner Methode einbaue Gibts ... Kann mir jemand auf die Sprünge helfen damit der MIDL nicht mehr streikt? ... Next by Date: ...
    (microsoft.public.de.vc)
  • Re: HRESULT only required for Automation-compatible interfaces?
    ... Even in a interface, you are still limited to MIDL types (note ... for generating marshalling support - but you explicitly don't want it. ... to the same flavor of CRT DLL (otherwise, binary layout of the string ...
    (microsoft.public.vc.atl)