473,385 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

MSIDL to C#

Can anyone tell me if it is possible to generate C# from IDL/MSIDL ...

I would love a www refence with a command example if possible :-)

Cheers,
Random
Nov 17 '05 #1
10 3332
Random,

Oddly enough, it is possible, but it won't ALWAYS map correctly.
However, most of the time, it does.

You should check out Reflector, located at (watch for line wrap):

http://www.aisto.com/roeder/dotnet/

Basically, you can compile the IL into an assembly, then disassemble it
using this tool, and it will give you the C# source code.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Random Task" <Ra****@Task.be> wrote in message
news:JW*******************@news20.bellglobal.com.. .
Can anyone tell me if it is possible to generate C# from IDL/MSIDL ...

I would love a www refence with a command example if possible :-)

Cheers,
Random

Nov 17 '05 #2
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:Od**************@TK2MSFTNGP14.phx.gbl...
Random,

Oddly enough, it is possible, but it won't ALWAYS map correctly.
However, most of the time, it does.

You should check out Reflector, located at (watch for line wrap):

http://www.aisto.com/roeder/dotnet/

Basically, you can compile the IL into an assembly, then disassemble it
using this tool, and it will give you the C# source code.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Random Task" <Ra****@Task.be> wrote in message
news:JW*******************@news20.bellglobal.com.. .
Can anyone tell me if it is possible to generate C# from IDL/MSIDL ...

I would love a www refence with a command example if possible :-)

Cheers,
Random



The OP said I*D*L not IL. I guess he's talking about the COM interface
definition language - or a typo ;-)

You cannot generate C# from IDL AFAIK. Things like IUnknown have no
correlation in .NET as its garbage collected rather than reference counted.

What are you trying to acheive?

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk?
Nov 17 '05 #3
I have a spec for a framework ... it is all specified in OMG IDL (i.e.
CORBA) ... i wanna write the code in C# (not C++ ada etc) ... so i wanna
generate classes from the IDL ... make sense?

Richard Blewett [DevelopMentor] wrote:
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:Od**************@TK2MSFTNGP14.phx.gbl...
Random,

Oddly enough, it is possible, but it won't ALWAYS map correctly.
However, most of the time, it does.

You should check out Reflector, located at (watch for line wrap):

http://www.aisto.com/roeder/dotnet/

Basically, you can compile the IL into an assembly, then disassemble it
using this tool, and it will give you the C# source code.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Random Task" <Ra****@Task.be> wrote in message
news:JW*******************@news20.bellglobal.com ...
Can anyone tell me if it is possible to generate C# from IDL/MSIDL ...

I would love a www refence with a command example if possible :-)

Cheers,
Random



The OP said I*D*L not IL. I guess he's talking about the COM interface
definition language - or a typo ;-)

You cannot generate C# from IDL AFAIK. Things like IUnknown have no
correlation in .NET as its garbage collected rather than reference counted.

What are you trying to acheive?

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk?

Nov 17 '05 #4
I have a spec for a framework ... it is all specified in OMG IDL (i.e.
CORBA) ... i wanna write the code in C# (not C++ ada etc) ... so i wanna
generate classes from the IDL ... make sense?
Nov 17 '05 #5
Sorry here's my actual problem:

I have a spec for a framework ... it is all specified in OMG IDL (i.e.
CORBA) ... i wanna write the code in C# (not C++ ada etc) ... so i wanna
generate classes from the IDL ... make sense?
Nov 17 '05 #6

"Random Task" <Ra****@Task.be> wrote in message
news:JW*******************@news20.bellglobal.com.. .
Can anyone tell me if it is possible to generate C# from IDL/MSIDL ...

I would love a www refence with a command example if possible :-)

Cheers,
Random


You can't directly generate C# from IDL, if your IDL file is a COM IDL, you
can use the typelib (created from your IDL file using MIDL.EXE) as input for
tlbimp.exe to create an interop assembly.

Willy.

Nov 17 '05 #7
Willy Denoyette [MVP] wrote:
"Random Task" <Ra****@Task.be> wrote in message
news:JW*******************@news20.bellglobal.com.. .
Can anyone tell me if it is possible to generate C# from IDL/MSIDL ...

I would love a www refence with a command example if possible :-)

Cheers,
Random

You can't directly generate C# from IDL, if your IDL file is a COM IDL, you
can use the typelib (created from your IDL file using MIDL.EXE) as input for
tlbimp.exe to create an interop assembly.

Willy.


Thank you ... that's really to bad ... i'll definitely consider doing
things the way you have suggested ... I was hoping to get some free code
generated for me :-)
Nov 17 '05 #8
I see what you mean now. Well, I don't know if this will work, but you
could run the OMG IDL through the MIDL compiler (I'm not familiar with OMG
IDL in relation to MIDL, I'm assuming they are somewhat the same). It
should spit out a type library.

You could then set an interface to that type library in your project,
and then implement it on your classes.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Random Task" <Ra****@Task.be> wrote in message
news:6f*******************@news20.bellglobal.com.. .
Sorry here's my actual problem:

I have a spec for a framework ... it is all specified in OMG IDL (i.e.
CORBA) ... i wanna write the code in C# (not C++ ada etc) ... so i wanna
generate classes from the IDL ... make sense?

Nov 17 '05 #9

"Random Task" <Ra****@Task.be> wrote in message
news:In*******************@news20.bellglobal.com.. .
Willy Denoyette [MVP] wrote:
"Random Task" <Ra****@Task.be> wrote in message
news:JW*******************@news20.bellglobal.com.. .
Can anyone tell me if it is possible to generate C# from IDL/MSIDL ...

I would love a www refence with a command example if possible :-)

Cheers,
Random

You can't directly generate C# from IDL, if your IDL file is a COM IDL,
you can use the typelib (created from your IDL file using MIDL.EXE) as
input for tlbimp.exe to create an interop assembly.

Willy.


Thank you ... that's really to bad ... i'll definitely consider doing
things the way you have suggested ... I was hoping to get some free code
generated for me :-)


Don't know what you are after but MIDL does generate 'C' code only, not C#
code, but it won't generate a typelib from OMG IDL.
Note also that there is no mapping of OMG CORBA API's to .NET, so even the C
stubs cannot be used with the Framework , so your only option is C++ (even
Managed C++ will do and is part of .NET) and CORBA.

Willy.


Nov 17 '05 #10
You can also take a look at:

http://remoting-corba.sourceforge.net/

It's a C# library that basically maps the C# remoting to corba.

They have an IDL compiler as well that may be closer to what you need, but
you'll need to get it out of CVS and build it since they haven't released it
yet (I don't think).

Pete

"Random Task" <Ra****@Task.be> wrote in message
news:In*******************@news20.bellglobal.com.. .
Willy Denoyette [MVP] wrote:
"Random Task" <Ra****@Task.be> wrote in message
news:JW*******************@news20.bellglobal.com.. .
Can anyone tell me if it is possible to generate C# from IDL/MSIDL ...

I would love a www refence with a command example if possible :-)

Cheers,
Random

You can't directly generate C# from IDL, if your IDL file is a COM IDL,
you can use the typelib (created from your IDL file using MIDL.EXE) as
input for tlbimp.exe to create an interop assembly.

Willy.


Thank you ... that's really to bad ... i'll definitely consider doing
things the way you have suggested ... I was hoping to get some free code
generated for me :-)

Nov 17 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.