Prrrrrleeeeaaaaseeee?????

Discussion in 'Questions (Windows Mobile)' started by Cableguy, Aug 27, 2007.

  1. Cableguy

    Cableguy Expert Licensed User

    Erel, Could you please post a sample wrapper source-code?
     
  2. agraham

    agraham Expert Licensed User

    Hi Cableguy. What do you want that is different ,or in addition, to the Scroll Bar example that Erel has already posted?
     
  3. Cableguy

    Cableguy Expert Licensed User

    the scrool bar uses known namespaces and therefore are (now) straight foward to implement..
    I just can figure out how to "call" an outside dll and "refer" to it to build a wrapper...
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    What do you want to wrap?
    There are two kinds of things you can wrap, one is a native dll and the other is a .Net dll.
     
  5. Cableguy

    Cableguy Expert Licensed User

    I "wish" to wrapp the two libraries I found and posted inthe "wishList" forum!!

    Maybe head over feet but Im willing....
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    The GemBox component is a .Net component.
    You should try adding the dll to Basic4ppc directly.
    If the dll includes methods not supported by Basic4ppc you should create a .Net project, add a reference to this dll and create the required methods and properties.
    It will only work on the desktop as this is not a .Net CF dll.
     
  7. agraham

    agraham Expert Licensed User

    You declare the entry points in the non.NET dll as follows

    Code:
    // for C#
        [DllImport(
    "User32.dll")]
        
    public static extern int MessageBox(int h, string m, string c, int type);

        
    ' for VB
    Declare Auto Function MBox Lib "user32.dll" Alias "MessageBox" ( _
        ByVal hWnd 
    As Integer, _
        ByVal txt 
    As String, _
        ByVal caption 
    As String, _
        ByVal Typ 
    As Integer) _
        
    As Integer

        
    ' also for VB
      <DllImport("User32.dll")>
    Public Shared Function MBox Lib "user32.dll" Alias "MessageBox" ( _
        ByVal hWnd 
    As Integer, _
        ByVal txt 
    As String, _
        ByVal caption 
    As String, _
        ByVal Typ 
    As Integer) _
        
    As Integer
    Then use them as normal methods, a bit of documentation from VS 2005 attached.

    EDIT: Open the doc in Wordpad - despite telling it to save it as txt it seems to be rtf!
     

    Attached Files:

    Last edited: Aug 28, 2007
  8. dzt

    dzt Active Member Licensed User

    Hi all,

    1. Access to native DLLs (native DLL is a DLL compiled to machine code) can't be accieved from B4PPC directly (now and in the future).

    The reason is that there is no way to do that trough C# (The .NET language behind B4PPC) at runtime. And C# runtime (I repeat, runtime not design time) limits are the upper limits of B4PPC by it's nature.

    Therefor a NET wrapper is always needed.

    2. Access to .NET DLLs theoritically could be done trough B4PPC directly (without a wrapper) if B4PPC could have support for every data type supported by C#.NET. For now B4PPC have serious limitations on this.

    So a wrapper is needed to convert complex .NET data types to well known B4PPC data types.
     
  9. dzt

    dzt Active Member Licensed User

    To refer to a .NET DLL from SharpDevelop to "Projects" panel, right click "references", click ".NET Assembly Browser" tab, click "Browse" button and select your .NET DLL.

    Now its elements are accessible from your code.
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    It is more accurately to say that Basic4ppc doesn't support custom data types. It does support all primitive data types (including Object data type).
     
  11. agraham

    agraham Expert Licensed User

    Last edited: Aug 28, 2007
  12. dzt

    dzt Active Member Licensed User

  13. dzt

    dzt Active Member Licensed User

    I must agree that the above is more accurate:)
     
  14. Cableguy

    Cableguy Expert Licensed User

    I tryed it already and it does add a lot of object but error because there's a few objects bettween classes that are named the same....
    Also none of the available objects seem to be "callable"....
     
Loading...