Wrapper method for UF_UI_message_dialog

Hi all!
I want to make question dialog with two buttons, that have custom labels: "Electrical port" and "Mechanical port". I have tried to use UF_UI MessageDialog Method, but it looks like i doing somthing totally wrong, because NX dose not show any dialog window, but i see message "building file selection dialog" at the bottom of the NX window. It is my code below, could you help me?

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpenUI
Imports System.Runtime.InteropServices

Module NXJournal
Public theSession As Session = Session.GetSession()
Public ufs As UFSession = UFSession.GetUFSession()
Public lw As ListingWindow = theSession.ListingWindow

Sub Main()

Dim resp As Integer
Dim messages(0) As String
messages(0) = "What type of port is highlighted"
Dim but As UFUi.MessageButtons
but.button1 = True
but.label1 = "Electrical port"
but.response1 = 1
but.button2 = True
but.label2 = "Mechanical port"
but.button3 = False
but.response1 = 2

MessDi("", UiMessageDialogType.UiMessageInformation, messages, 1, True, but, resp)

lw.Open()
lw.WriteLine("resp= " & resp)

End Sub

Public Sub MessDi( _
ByVal title_string As String, _
ByVal dialog_type As UiMessageDialogType, _
ByVal messages As String(), _
ByVal num_messages As Integer, _
ByVal translate As Boolean, _
ByRef buttons As UFUi.MessageButtons, _
ByRef response As Integer _
)
End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
End Function

End Module

Try this:

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module Module1

Dim theSession As Session = Session.GetSession()
Dim theUfSession As UFSession = UFSession.GetUFSession()

Dim theUI As UI = UI.GetUI()
Dim lw As ListingWindow = theSession.ListingWindow

Sub Main()

Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "NXJ")

lw.Open()

Dim titleString As String = "title"
Dim resp As Integer
Dim messages(0) As String
messages(0) = "What type of port is highlighted"
Dim but As UFUi.MessageButtons
but.button1 = True
but.label1 = "Electrical port"
but.response1 = 1
but.button2 = True
but.label2 = "Mechanical port"
but.response2 = 2
but.button3 = False

theUfSession.Ui.MessageDialog(titleString, UiMessageDialogType.UiMessageQuestion, messages, messages.Length, False, but, resp)

lw.WriteLine("resp= " & resp)

lw.Close()

End Sub

Public Function GetUnloadOption(ByVal dummy As String) As Integer

'Unloads the image immediately after execution within NX
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

End Function

End Module

Thank you, very much!