Example: /Util/IOMasterPort via SoftDeclare

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/Util/IOMasterPort via SoftDeclare


Required plugins for this example: MBS Util Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/IOMasterPort via SoftDeclare

This example is the version from Sun, 17th Mar 2012.

Project "IOMasterPort via SoftDeclare.xojo_binary_project"
Class Window1 Inherits Window
EventHandler Sub Open() dim s as SoftDeclareMBS dim m as MemoryBlock dim p as MemoryBlock // kern_return_t IOMasterPort( mach_port_t bootstrapPort, mach_port_t * masterPort ); m=NewMemoryBlock(8) p=NewMemoryBlock(4) s=new SoftDeclareMBS p.Long(0)=0 // the port value will be placed here m.Long(0)=0 // constant MACH_PORT_NULL m.Long(4)=p.AddressMBS(0) // Pointer for second parameter to p if s.LoadLibrary("System.framework") then if s.LoadFunction("IOMasterPort") then if s.CallFunction(2,m) then MsgBox "Result: "+str(s.Result)+", Port: "+str(p.Long(0)) end if end if end if End EventHandler
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project

The items on this page are in the following plugins: MBS Util Plugin.


💬 Ask a question or report a problem