Announcement

Collapse
No announcement yet.

PowerBasic AND DotNet

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PowerBasic AND DotNet

    Hi everybody,

    After extensively working with VB6 in an Telecomm environment (GPRS, Satellites and Digital Radios linked to GIS) I am moving to DotNet VB and C#. I have worked with PowerBAsic Dos (Excellent development language) and after reading many comments on version 9, I believe is one of the most efficient ways to write DLL´S.

    But, have alot of doubts regarding the following:

    1. Can I write DLL´S with PowerBasic that can be used in VB and C# 2005 to 2008?.
    2. If so, can anyone give me a lead as to how to do it?.
    3. Are there any catches working with .NET frameworks 1 and 2?
    4. Are there any catches working with XP, Vista and Windows 7 Beta (Installing PowerBasic adn creating the DLL´S)?.

    I would appreciate any help, comments, tips and suggestions on this issue.

    Regards,

    JARP

  • #2
    1. Yes. They will be classed as "Unmanaged DLLs" in .NET

    2. Search the forum. There should be at least one example.

    3. Not that I know of. The differences between the .NET versions are in the classes provided (fixes and new features), not core code, such as calling a DLL. Obviously you need the .NET runtimes installed for the version you are writing code for (I think we're up to .NET 3.5 now)

    4. Not with PB itself, but the Windows API has many various pitfalls you might encounter between versions of Windows. Vista UAC and limited permissions mode on XP are two things that may limit what your code can do. It really depends on what you want to do in PB?
    kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

    Comment


    • #3
      My GDImage.dll, that is written in PB, works fine with C# VS2005, however the DotNET GC (garbage collector) has been the major issue i had to deal with.

      If you want you can try the GDImage C# carousel project there.

      ...
      Last edited by Patrice Terrier; 10 Feb 2009, 12:59 AM.
      Patrice Terrier
      www.zapsolution.com
      www.objreader.com
      Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

      Comment


      • #4
        There is 1 small "gotcha" when using C# & PB Dlls with .Net v1 or 2.
        When returning a string from the dll to C#, the documented method
        doesn't work. You have to work with the string address & length
        seperately (?). This is only for a function that returns a string.
        Passing strings back/forth as parameters works fine.

        This is NOT a problem with PB. MS tech support acknowledged it was
        a fault in the .Net runtimes and would be "fixed" in the next major
        release. I discovered this a couple years ago. If you search for my
        name in their support forum, you can find out the details.

        Hope this helps.

        Comment


        • #5
          @Alberto,

          with .NET you can use 3 types of DLLs:

          1. .NET DLLs
          2. COM DLLs (the old Microsoft world)
          3. Windows standard DLLs, which can be generated using PowerBasic, C etc.

          If have nether found problems using VB.Net with Windows standard DLLs (written in PowerBasic), but my last use of .Net development environment was in 2006.

          Since then i use a more productive, leaner and faster software development environment for my projects: PowerBasic !

          bye,
          Volker
          www.zentrader.de (Trading system development and simulation tools)

          Comment


          • #6
            I just downloaded and installed the C# VS2008 Express Edition, to try it with my PowerBASIC GDImage.dll.

            Unfortunatly it doesn't work with it, because i am on VISTA x64 and the VS2008 generates automaticaly x64 code instead of x32, and so far i didn't find how to configure the Express Edition to generate a 32x target solution.

            ...
            Patrice Terrier
            www.zapsolution.com
            www.objreader.com
            Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

            Comment


            • #7
              Patrice, check this.
              Seems to be a limitation of the Express edition UI, but you could manually change the TargetPlatform in the project file.

              Bye!
              -- The universe tends toward maximum irony. Don't push it.

              File Extension Seeker - Metasearch engine for file extensions / file types
              Online TrID file identifier | TrIDLib - Identify thousands of file formats

              Comment


              • #8
                Originally posted by Patrice Terrier View Post
                I just downloaded and installed the C# VS2008 Express Edition, to try it with my PowerBASIC GDImage.dll.

                Unfortunatly it doesn't work with it, because i am on VISTA x64 and the VS2008 generates automaticaly x64 code instead of x32, and so far i didn't find how to configure the Express Edition to generate a 32x target solution.

                ...
                Patrice,
                Did you install the 64bit version? I installed the full (Vb,C++,C#) 32 bit version on my Vista64 and it runs fine. I knew I wanted primarily 32 bit apps and it was the iso I had on hand.

                James

                Comment


                • #9
                  James, Marco,

                  When I downloaded the VS2008 C# Express Edition from Microsoft, i was not asked for a specific platform.

                  The vcssetup.exe don't give me any choice.

                  I did try manualy to change the target platform from "AnyCPU" to "x86" with no luck.

                  Because i am doing more than 90% of my business out of the PB's market, being unable to produce a 64-bit DLL is getting a real pain for me.
                  Patrice Terrier
                  www.zapsolution.com
                  www.objreader.com
                  Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

                  Comment


                  • #10
                    Following M$ ideas over the last few years, I will bet the problem is the ASSUMPTION that the compile you want to do is the same as your OS, and not the compile you want to do.

                    Although little (if any) experience I would think "Cramming a smaller value into a larger values capable" is easy but vice versa, the roll of the dice.

                    Point to be made, if not the same environment, then not the same answer.....(although I will admit, a "close" environment will result in a "close" results)

                    Given that,
                    I trust Patrice's code (within its scope) more than I trust M$ with a "Free Download" that can not have full functionality
                    Engineer's Motto: If it aint broke take it apart and fix it

                    "If at 1st you don't succeed... call it version 1.0"

                    "Half of Programming is coding"....."The other 90% is DEBUGGING"

                    "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                    Comment

                    Working...
                    X