Purpose
Creates a new ribbon instance. Initializes instance with MapInfo platform and own application.
Type: MapBasic Sub
Return Value: This
Syntax
call Initialize(myAddIn, SYSTEMINFO(SYS_INFO_IMAPINFOAPPLICATION), ApplicationName$() )
myAddIn: Name of the instance
SYSTEMINFO(SYS_INFO_IMAPINFOAPPLICATION): Running MapInfo application
ApplicationName$() : Running application (the name of the mbx file)
Description
The function returns a new ribbon instance for each application. You have to call this function from the main sub of your MapBasic application. To define the name of the instance set a variable Global myAddIn as This. You can use these variable to initializes the application or to remove the initialization, e. g. within the EndHandler
Example
The following example creates a new instance and Initializes the instance with Mi platform and application
Declare Method New_RibbonSDK Class "GeoAS.RibbonSDK.Addin" Lib "GeoAS.RibbonSDK.dll" Alias Ctor_CreateInstance() as This
Declare Method Initialize Class "GeoAS.RibbonSDK.Addin" Lib "GeoAS.RibbonSDK.dll" Alias Initialize(ByVal p1 as This, ByVal p2 as refptr, ByVal p3 as String)
Global myAddIn as This
'**********************************
sub Main
'Create a new ribbon instance
myAddIn = New_RibbonSDK()
'Initializes instance with Mi platform and application
call Initialize(myAddIn, SYSTEMINFO(SYS_INFO_IMAPINFOAPPLICATION), ApplicationName$() )
end sub
'Important! Each Mapbasic program requires an end handler with unload calling.
'******************************
Sub EndHandler
call Unload(myAddIn)
End Sub
'******************************