Results 1 to 8 of 8

Thread: to compile from one language to other

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    275

    to compile from one language to other

    Since Visual Studio.Net comprises of some languages including C#, VB, J# etc
    I have heard that .Net has a common compiler i.e. A program of VB can be compiled in VC#.Net and so on. If it is true then it may also be possible that to convert a code of VC# into VB and vice versa
    Please tell me the details

    Q2. I can make an exe file in VB6 but I cannot figure out how this is done in VB.Net

  2. #2
    Hyperactive Member nothingofvalue's Avatar
    Join Date
    Jul 2005
    Location
    Arizona
    Posts
    489

    Re: to compile from one language to other

    Courtesy of JMC's signature.

    C# to VB.net
    http://www.developerfusion.co.uk/uti...sharptovb.aspx

    VB to C#
    http://www.developerfusion.co.uk/uti...btocsharp.aspx


    2. Run your program the .exe is created and put in the bin diretory
    "Imagination is more important than knowledge..."

    Albert Einstein
    -----------------------------------------------
    If my reply helped you then you really were lost, but I still took the time to help, please rate it anyway

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: to compile from one language to other

    You can convert code from one language to another with converters like those that NOV mentions, but the IDE will not do it for you and there is no actual "compiling" from one language to another. Every .NET project, regardless of the development language, gets compiled to Microsoft Intermediate Language. There is a seperate compiler for each development language but they all produce MSIL. Other companies have produced .NET compilers for their products too, including Borland Delphi. One you have a .NET assembly containing MSIL, it doesn't know or care what language it was originally developed in. You can disassemble that assembly into a development language, but it will not necessarily be the same code as was originally written. It will be whatever the disassembler considers to be the closest match to the MSIL. I believe that ildasm.exe, supplied by Microsoft, can at least produce VB and C# but I don't know about others.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    275

    Resolved Re: to compile from one language to other

    Quote Originally Posted by nothingofvalue
    Courtesy of JMC's signature.

    C# to VB.net
    http://www.developerfusion.co.uk/uti...sharptovb.aspx

    VB to C#
    http://www.developerfusion.co.uk/uti...btocsharp.aspx


    2. Run your program the .exe is created and put in the bin diretory
    Thanks Buddy

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    275

    Re: to compile from one language to other

    Can anyone plz tell me how the procedure of compiling from one language to other is done? Not code translation

  6. #6
    Fanatic Member
    Join Date
    Jan 2006
    Posts
    710

    Re: to compile from one language to other

    You can't compile from one .NET language to another. Source code in one language is compiled to IL, not to another .NET language.

    For conversion of source code, you can use converters (such as ours of course ).
    David Anton
    Convert between VB, C#, C++, & Java
    www.tangiblesoftwaresolutions.com

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2006
    Posts
    275

    Re: to compile from one language to other

    Actually I mean that I am designing a VB application then add in it a C# form etc and the whole application works fine
    Is it possible in .NET

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: to compile from one language to other

    If you'd said that in the first place...

    All .NET projects compile to a .NET assembly, which contains MSIL. There is no link whatsoever to the language it was developed in. If you compile a VB.NET project to a DLL then you can reference that DLL in any .NET project, be it C#, VB.NET, J#, C++.NET, Delphi or whatever. You already do this all the time. The whole .NET Framework is written in C# and you reference those assemblies in VB.NET projects, etc. Just note that you cannot reference an application form another application. Only libraries, i.e. DLLs, can be referenced.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width