Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

MBS Xojo Plugin Tutorial Videos

Bonjour Source

Class App
Inherits Application
// Constants
Const kFileQuitShortcut = Ctrl+Q
Const kFileQuit = E&xit
Const kEditClear = &Delete
End Class

Class Window1
Inherits Window
// Controls
ControlInstance
End ControlInstance

// Properties
Dim browser As MyBrowser
Dim Lookups(-1) As MyLookup

// Event implementations
Sub Open()
StartBrowse
End Sub

// Methods
Sub StartBrowse()
browser=new MyBrowser

if browser.Browse(0,"_afpovertcp._tcp","") then
// ok
else
Listbox1.AddRow "Failed"
end if

End Sub
Sub StartLookup(name as string, typ as string, domain as string, listboxindex as integer)
dim l as new MyLookup

l.ListboxIndex=listboxindex

if l.Lookup(0,name,typ,domain) then
// ok
else
listbox1.cell(listboxindex,1)="failed"
end if

Lookups.Append l
End Sub
End Class

Class MyBrowser
Inherits DNSServiceBrowseMBS
// Event implementations
Sub ServiceBrowse(Flags as integer, InterfaceIndex as integer, ErrorCode as integer, ServiceName as string, RegType as string, Domain as string)
const kDNSServiceFlagsAdd=2

dim f as integer

f=BitwiseAnd(flags, kDNSServiceFlagsAdd)

if f<>0 then // added
window1.ListBox1.AddRow ServiceName
window1.StartLookup ServiceName, RegType, domain, window1.ListBox1.LastIndex
else
// removed

end if
End Sub
End Class

Class MyLookup
Inherits DNSServiceResolveMBS
// Properties
Dim ListboxIndex As Integer

// Event implementations
Sub ServiceLookup(flags as integer, InterfaceIndex as integer, ErrorCode as integer, Fullname as string, Hosttarget as string, Port as integer, TxtRecord as string)
window1.ListBox1.Cell(ListboxIndex,1)=DNSNameToAddressMBS(Hosttarget)+":"+str(port)
window1.ListBox1.cell(ListboxIndex,2)=Hosttarget

End Sub
End Class


All movies




Links
MBS FileMaker blog