How to create a Basic4ppc library

dzt

Active Member
Licensed User
Hi dennishea,

Attached is a complete C# project (with compiled DLL) for Compact FramewWork 1.0. You can change it to CF 2.0 or anything else (through Sharp Develop Project Properties)

Attached also is the appropriate b4ppc file.
 

Attachments

  • MyDLL.zip
    4.4 KB · Views: 381
  • test13_MyDLL.sbp
    675 bytes · Views: 340

dennishea

Active Member
Licensed User
Thanks dzt. I appreciate your time for this. Thanks again and hope your day goes well.

:)

dennishea

edit:

If I would've known about being able to choose which cf. It took me a minute to find where the selection window was for changing it to cf2. While I was waiting for your input I did some reading on MSDN and learned a lot. My main problem with MSDN is I have a hard time finding what I'm looking for and when I do an even harder time understanding it. That's what I get for being a 61 year old high school drop out. Thank You Thank You Thank You dzt for your help. I am now growing hair again.

:sign0060: :sign0008:
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
That's what I get for being a 61 year old high school drop out. Thank You Thank You Thank You dzt for your help. I am now growing hair again.
I'n Portugal we have a saying that goes like this:

"Old donkeys don't learn new languages"

My dad is 65, never went beyond the 3rd grade, and his most ambicious chalange was to get is driver's license at 42....

This is to say that you, or anybody else for the matter, should not feel diminished for not having a phd, md or whatever....
I could only wish my dad was interested in computers when I was grouwing up...It would have made adolescence so much easyer....

I praise you all, old timers, that still have the will to learn new things....

:sign0188::sign0188::sign0188::sign0188:
 

dennishea

Active Member
Licensed User
Thank You cableguy & erel. I can't seem to find the words to express how your kind words make me feel.

dennishea
 

lairdre

Member
Licensed User
pass exception back

Erel,
When writing a dll for B4PPC, if I have an exception in one of my methods, how do I pass it back to the calling code in B4PPC?

Is my only option to return from the fucntion false?

Do I have access to any other code in the application from my dll.

I have a few dll's I would like to publish, but I need to clean up the error handling first.

Thanks,

Ron Laird
 

lairdre

Member
Licensed User
Dlls

From my dll, do I have access to any of the object in any other dll's that are loaded. I guess I am asking how namespaces are actually handled.

Ron
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You could access any of the objects only if the user passes the object inside a method call.
Like using ControlRef / Value properties which are usually just references to the real object.
It allows the user to pass the object to a method.
In your method declaration you should except an object and now cast it to whatever requires.
 

Louis

Active Member
Licensed User
Longtime User
Hi. The next time I have string to unmanaged native C pointers issues with .NET especially with 1.1 how can I fix this? My screen reader JAWS is not able to read Sharp Develop errors properly to me because some of the list boxes are not regular Windows List boxes but are customized with lots and lots of pictures. But I still can manage to use parts of the IDE JAWS is able to read to me. But if I find out how to fix errors that aren't obvious, this way, I don't have to keep submitting ok compiled dlls but unrunnable ones that have errors at runtime, unless people don't mind helping me out when no one at home can? Thanks very much. Also, is there a way to capture these errors to ASCII text files or to an HTML file so I can see exactly what they are in another editor? Thanks.
 

thearrow

New Member
You can make b4ppc libraries with #develop.
...
Attached are scrollbar and vb-scrollbar examples for #develop.

Hi,

I downloaded your example and just compiled it with #develop (last version). The dll work correctly then I test it with b4ppc on my desctom computer. But when I try to add dll in a b4ppc project on my compact device, I get messagebox that "an error occured. NotSupportedException". Can you tell me what I do wrong.

Device: HTC Artemis, WM6

Thanks.
 

dzt

Active Member
Licensed User
Hi,

Menu->"Project"->"Project Options"
Click "Compiling" tab".
At "Target Framework" combo, select "Compact Framework 1.0" or "Compact Framework 2.0".

First you should install Compact Framework SDK.
 

Louis

Active Member
Licensed User
Longtime User
Hi. I code my DLLS in Vb.NET. If I have a class named "Const", and Const is a reserved keyword, and because this .net library is closed-source, how can I use this "Const" class? It has some unsined hexadecimal integers it returns that I need to use. If I convert these integers, they turn into signed integers and I get errors. Thanks.
 

Louis

Active Member
Licensed User
Longtime User
Hi. I am trying to wrap a c# class from within a VB.NET library, but the class from the C# dll is named Const. It returns unsigned Hexadecimals I nee to pass to a couple of other subs/functions. The problem is that in VB.NET Const is also used to declare Constants. So how can I use this kind of conflicting class? Thanks.
 

agraham

Expert
Licensed User
Longtime User
If it is a C# dll I presume you have a reference to it in your project rather than using DLLImport (aka Declare). The class Const should be in its' own namespace in that dll so try referring to it as "WhateverNamespace.Const"
 
Last edited:

Louis

Active Member
Licensed User
Longtime User
Hi, thanks but however when I do that, VB.NET says that Const must be used as declaring variable types and can't be a class. This C# dll I am trying to wrap is closed, but I'm making a wrapper for it in VB.NET for Basic4ppc. I guess I could try letting Basic4ppc deal with passing the Constance in the Const class to my wrapper? Thanks.
 

agraham

Expert
Licensed User
Longtime User
What are you using? This works for me in VS2005

B4X:
C# DLL
-----------------------
namespace ClassLibrary1
{
    public class Const
    {
        public Const()
        {
        }

        public String Version
        { get { return "Const" ;}}
    }
}

-------------------
VB.NET
-------------------
Imports ClassLibrary1

Public Class Form1
    Dim Test As ClassLibrary1.Const = New ClassLibrary1.Const

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        MsgBox(Test.Version)
    End Sub
End Class
 

Louis

Active Member
Licensed User
Longtime User
Hi. I am having a hard time following the ScrollBar VB example for creating and raising events in a Basic4ppc library. Can someone show me a more simpler example of how I can raise events to activate in Basic4ppc maybe show an infinite loop of a counter being incremented by 1 and when it gets to 10 the loop raises an event to Basic4ppc and exits? Thanks.
 
Top