Menu

Rebuild BPP by MINGW for 32bit and 64bit

2019-12-20
2025-12-07
  • Hong Bin Han

    Hong Bin Han - 2019-12-20

    Sorry for my poor english.

    I find this project last month. and rebuild it by MINGW(8.1.0) for 32bit and 64bit
    .fixed some bugs( samples can not compile , library link error, etc )
    .COM binding
    .GUI can apply the windows theme.
    .using C++ code two ways
    1. #CPP code
    #char progname[1024]
    #GetModuleFileName(NULL, progname, sizeof(progname))
    2. inside the double {{ }}
    {{
    char progname[1024];
    GetModuleFileName(NULL, progname, sizeof(progname));
    }}

     . WITH improvment  
                    with Xls.Cells(1, 1)
                                .Value = "Name"
                                with .Font
                                        .Bold = TRUE
                                        .ColorIndex = 2
                                end with
                                .Interior.ColorIndex = 30
                    end with
    

    Now i am Adding GUI controls by myself.

     

    Last edit: Hong Bin Han 2019-12-20
  • Hong Bin Han

    Hong Bin Han - 2019-12-20

    Option Explicit
    Option CONSOLE OFF

    Dim App As New BApplication
    Dim Form1 As New BForm
    Dim Tree1 As New BTreeView

    Private Sub Form1_DblClick(Button As Long)
    MsgBox "Form1 DoubleClick!"
    End Sub

    Private Sub SampleTreeView

    Dim hRoot AS Long, hParent AS Long
    Dim i AS Integer,j AS Integer, k AS Integer
    Dim lCount As Integer = 5
    
    FOR i = 1 TO lCount
        hRoot = Tree1.InsertItem(0, "Root"+ str(i) )
        FOR j = 1 TO lCount
            hParent = Tree1.InsertItem(hRoot, "Item"+ STR(j) )
            FOR k = 1 TO lCount
                Tree1.InsertItem(hParent, "SubItem"+ STR(j) + "." + STR(k)) 
            NEXT k
        NEXT j
    NEXT i
    

    End Sub

    Sub Main

    App.Create
    
    Form1.OnDblClick = AddressOf Form1_DblClick
    
    Form1.Caption = "B++ Test Application"
    Form1.Startup = True 'you must set startup to some form to correct program exit
    Form1.Style = wsSizable
    
    Form1.Create
    
    Tree1.Caption = "Tree1"
    Tree1.Parent = Form1.hWnd
    Tree1.Height = Form1.ClientHeight - 20
    Tree1.Width = Form1.ClientWidth - 20
    Tree1.Top = 10
    Tree1.Left = 10
    
    Tree1.Create
    
    Call SampleTreeView
    
    App.Run
    
    App.Destroy
    

    End Sub

     
  • Hong Bin Han

    Hong Bin Han - 2019-12-20

    below com samles works well 32bit and 64bit

    Option Explicit
    Option CONSOLE OFF

    Sub Main

    DIM Xlb As ComObject, Xls AS ComObject, Rng AS ComObject,xlapp AS ComObject
    
    xlapp.CreateObject("Excel.Application")
    xlapp.Visible = TRUE
    
    Xlb = xlapp.Workbooks.Add
    Xls = Xlb.WorkSheets(1)
    
    with Xls.Cells(1, 1)
        .Value = "Name"
    
        with .Font
            .Bold = TRUE
            .ColorIndex = 2
        end with
        .Interior.ColorIndex = 30
        .Value = "Test value 1"
        .Value = "Test value 2"
        .Value = "Tets value 3"
        .Value = "Test value 4"
    end with
    
    Rng = Xls.Range("A1:A5")
    Rng.Font.Size = 14
    
    Rng = Xls.Range("A2:A5")
    Rng.Interior.ColorIndex = 36
    Rng.EntireColumn.Autofit
    
    xlapp.DisplayAlerts = FALSE
    msgbox "click to continue..."
    
    xlapp.quit
    

    End Sub

     

    Last edit: Hong Bin Han 2019-12-20
  • Hong Bin Han

    Hong Bin Han - 2019-12-20

    using C++ codes directly

    Function BCombo.WndProc

    {{
      if ( (WM_COMMAND) == uMsg ) {
        if ( HIWORD(wParam) == CBN_SELCHANGE ) {
          if ( OnSelectChanged > 0 ) {
    }}

                        RaiseEvent SelectChanged
    

    {{
          }
        }
      }
    }}
    Function = Super.WndProc(hWnd, uMsg, wParam, lParam)
    End Function

     

    Last edit: Hong Bin Han 2019-12-20
  • Zlatko Vidlanovic

    Hello Han
    I just stoped over BPP i almost forget avout it .
    You say that you recompile it with fixed bugs
    so ..may I ask is there recompiled version for download ?
    thanks

     

Log in to post a comment.

MongoDB Logo MongoDB