[V8i - VBA] MDL function mdlFileList_edit in VBA - how to process "FileListInfo"

Hi All,

I would greatly appreciate some help with the following VBA code where I am trying to use the MDL function mdlFileList_edit in VBA to select multiple DGNs for processing.
I am trying to retrieve the string values for "lastDirectory" and "lastFilter" from my variable lastInfoP but I only see empty strings.

I do not know how to process my variable lastInfoP after the dialog box is closed.
I've tried to translate the "FileListInfo" structure from "filelist.h" which returns the "state" of the file list dialog box upon termination of the box but I am unsure if I have interpreted it correctly.

Thank you.


Option Explicit

Declare Function mdlFileList_edit Lib "stdmdlbltin.dll" _
    ( _
        ByVal lastInfoP As Long, _
        ByVal stringListP As Long, _
        ByVal attributes As Long, _
        ByVal dialogTitle As String, _
        ByVal listLabel As String, _
        ByVal fileFilter As String, _
        ByVal defaultDirectory As String _
    ) As Long

Declare Function mdlStringList_destroy Lib "stdmdlbltin.dll" (ByVal pStringList As Long) As Long

' C:\Program Files (x86)\Bentley\MicroStation V8i (SELECTseries)\MicroStation\mdl\include\filelist.h
'typedef struct filelistinfo
'    {
'    int     lastAction;
'    char    lastDirectory[MAXFILELENGTH];
'    char    lastFilter[MAXEXTENSIONLENGTH];
'    } FileListInfo;
Type FileListInfo
    lastAction    As Long
    lastDirectory As String
    lastFilter    As String
End Type

Sub SelectDGNs()

    Dim stringListPout As Long

    Dim lastInfoP As FileListInfo
    Dim stringListP As Long
    Dim attributes As Long
    Dim dialogTitle As String
    Dim listLabel As String
    Dim fileFilter As String
    Dim defaultDirectory As String

    dialogTitle = "Select DGN Files for Processing:"
    fileFilter = "*.dgn"
    defaultDirectory = "C:\"

    stringListPout = mdlFileList_edit(VarPtr(lastInfoP), stringListP, attributes, dialogTitle, listLabel, fileFilter, defaultDirectory)

    Debug.Print "lastAction    = " & lastInfoP.lastAction
    Debug.Print "lastDirectory = " & lastInfoP.lastDirectory
    Debug.Print "lastFilter    = " & lastInfoP.lastFilter

    ' Deallocates memory associated with the string list.
    mdlStringList_destroy stringListPout

End Sub