Introduction

Creating a visual objects extensions can be useful in order to add features that do not exist in Visual Objects. 


Step 1: creating the sdk project

In order to create a Visual Objects extension you can use the following help file (creating and using sdk project section) to prepare an sdk project

[Visual Objects Program location]\Help\vo28sdk.chm




Step 2: Registering menu entries

a. After following steps to create an sdk project, create a new dll (new application | Empty dll)

b. Make sure following libraries are included:


c. Create a module with a register and an edit function. The following code example shows how this can be done:


FUNC REGISTER(pSubSys as _SUBSYS_DECL) as LOGIC STRICT

    pSubSys.wNEntities := 1
    pSubSys.entityDecl[1].uiEntityType := BL_COMMAND
    MemCopy(@pSubSys.achMenuName[1], ptr(_cast, "Checkout from git"), SLen("Checkout from git") + 1 )
    
RETURN true

FUNC EDIT (hParent as ptr, pCEB as _CREATEEDITBLOCK, pIB as ptr)  as LOGIC STRICT
LOCAL AppId as word
LOCAL ModuleRecordId as dword
LOCAL TotalModules    as dword
LOCAL TotalCheckouts as DWORD
LOCAL TotalApps as DWORD
    
    AdamGetFirstApp(@AppId) == SUCCESS
    DO WHILE AppId != NULL_AID
        TotalApps++
        AppGetFirstModule(AppId, @ModuleRecordId)
        DO WHILE ModuleRecordId != NULL_RID
            TotalModules++
            IF ModSetDebug(ModuleRecordId, DEBUG_ON, false) == SUCCESS
                TotalCheckouts++
            ENDIF
            IF AppGetNextModule(@ModuleRecordId) != SUCCESS
                RETURN false
            ENDIF
        ENDDO
        IF AdamGetNextApp(@AppId) != SUCCESS
            RETURN false
        ENDIF
    ENDDO
    
    MessageBox(null_ptr, String2Psz("Checked out " + Str(TotalCheckouts) + " files from git"), String2Psz(""), 0)
    MessageBox(null_ptr, String2Psz("Processed " + Str(TotalApps) + " apps"), String2Psz(""), 0)
    MessageBox(null_ptr, String2Psz("Processed " + Str(TotalModules) + " modules"), String2Psz(""), 0)

RETURN false


Step 3: Adding extension to Visual objects

Add the produced dll file to the visual objects bin directory and register this dll using the Cavo28.cfg file:

After succefully finishing step 1 to 3 a new menu will be added: