Building .NET DLLS Using Basic4ppc Generated C# code?

Discussion in 'Questions (Windows Mobile)' started by Louis, Jul 18, 2009.

  1. Louis

    Louis Active Member Licensed User

    Hi. Lots of people have asked for certain algorithms or some examples I have programmed. However, they don't necessarily use Basic4ppc, but either C# or Visual I may experiment with quite the idea. I know Basic4ppc generates C# code so I am wondering is it possible to build a module, let Basic4ppc do the translating, then open a new Visual Studio or Sharp Develop project, ad all required C# files, remove functions like __main_globals and rename it to something more sensible, and compile a DLL? You could simply delee the Sub App_Start and possibly get a DLL directly from Basic4ppc. What do you guys think, feasible or just a waste of time? This would be cool because we could code in quite an easy language but share our code with others who choose the harder paths.
    Last edited: Jul 18, 2009
  2. Erel

    Erel Administrator Staff Member Licensed User

    I think that it is currently feasible. You may have to solve some dependency issues but it is possible to do it.
    Note that the license doesn't allow distribution of Basic4ppc libraries source code.
  3. Louis

    Louis Active Member Licensed User

    Hi. Understandable about the Source Code issues. If I do figure it out, can I post the steps I took and will it be OK to distribute DLLS using this generated code for other programmers to benefit from, excluding the C# source? Thanks.
  4. Cableguy

    Cableguy Expert Licensed User

    Dlls Source code are not exclusive to the "Oficial" B4Ppc libraries, but also the user's developed dlls, in wich case their knowleage and permission should be prompted.
  5. eww245

    eww245 Member Licensed User

    Interesting idea, I assume it will work.
    As said the b4p variables like __main and all the standard DBasic code would need to be removed.
    I'd like to see how this experiment turns out.
  6. agraham

    agraham Expert Licensed User

    By now I know a lot about the C# emitted by Basic4ppc and it is certainly feasible but I doubt if it is sensible. I think that by the time you have learnt enough to turn the emitted code, which isn't very pretty as it doesn't need and isn't intended to be read by a human, into a valid C# dll that would compile and be usable by others you might as well just write it directly in C# or VB.NET. They are not actually very difficult nor very different to Basic4ppc if you just want to do the same in C# or VB.NET as in Basic4ppc.

    As is often the case it is not really the language syntax that is the problem but learning the infrastructure and processes needed to make working code with your chosen tools. You need to learn to use the tools anyway to make a dll or exe and will need to know some of the language to make valid classes with public constructors, methods and properties that are accessible to programs copiled against them, so its better and probably simpler to just take that extra step and write the code as well.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice