How to create a Basic4ppc library

Erel

B4X founder
Staff member
Licensed User
Longtime User
Creating libraries is pretty easy.
It can be done using C# or VB .Net and using Visual Studio 2003 or 2005 (professional version).
You should create a .Net CF class library.
The library should include at least one public constructor (which will be converted to New1, New2...).
You could use overloading (again, Basic4ppc will add the numbers as necessary).
Basic4ppc will handle the data conversion of the following types:
- Primitive types (int16, double, byte...).
- String.
- Control.
- Stream.
- Arrays of primitive types.
- Color
Events can also be used. See the attached example for the syntax of events.
If the class implements the IDisposable interface, Basic4ppc will call the Dispose method when the application ends (making sure that all the resources are freed).

If there is no need of a special function of .Net CF 2.0, it is better to target .Net CF 1.0 (to prevent the need to install .Net CF 2.0).
Attached is the source code of the ScrollBar library.
Please feel free to ask any question regarding the libraries.
 

Attachments

  • ScrollBar.zip
    3 KB · Views: 1,669

leo

Member
Licensed User
Please,
does somebody have an example of how to create a library for P4PPC in VB?
regards
 

maXim

Active Member
Licensed User
Longtime User

maXim

Active Member
Licensed User
Longtime User
Thanks for Your answer Mr. Erel,
Sigh... :(
However I will try there!:cool:
 

dzt

Active Member
Licensed User
you can with #develop

Hi,

You can make b4ppc libraries with #develop.
Requires downloading from Microsoft .NET 2.0 Framework SDK (included in Visual Studio 2005).
Visual Sttudio 2005 CF2 solutions (.sln) must be made from the beginning, as they does not work with #develop.
Attached are scrollbar and vb-scrollbar examples for #develop.

Dimitris
 

Attachments

  • SharpDevelop_ScrollBar.zip
    2.6 KB · Views: 665
  • SharpDevelop_VB-ScrollBar.zip
    2.6 KB · Views: 673

maXim

Active Member
Licensed User
Longtime User
Hi Dimitris,

Thanks for your contribution...

Very GOOD! ;)
 
Last edited:

gord

New Member
Licensed User
The final build SharpDevelop 2.1 has support for compact.Net it also has an emulator
 

Cableguy

Expert
Licensed User
Longtime User
Hi

I've never used #C before so i really don't know how to go from here.any good tutorial on dll develop?
 

dzt

Active Member
Licensed User
#develop has also support for VB.NET coding, not only C#. There is an option to convert C# projects to VB and vise versa.

This thread is a good start to learn how to develop libraries for B4PPC. Start playing with the example projects posted here and when you are stuck ask for help as always we all do!
 

dzt

Active Member
Licensed User
They are not talking about Compact Framework.

But if you want to give it a try, I keep on saying to try with SharpDevelop.
It is pretty easy and free.
 

Cableguy

Expert
Licensed User
Longtime User
Dzt, thanks for your input...
I keep strugling to get hold of an easy to understand tutorial, describing what things are, in oposition to "do it this way"....
Kinda of a simple sintax explanation and structure of the dll creation...

Could you crreate such a simple tutorial from your experience?
 

dzt

Active Member
Licensed User
Ok CableGuy,

I'll try to "teach you" (It's my first time through a forum) in easy steps how to make a simple inputbox library but since I'm very busy at the moment, I can't promise for the time.
 
Top