Include "mapbasic.def"
Include "menu.def"
Include "icons.def"
'声明部分
Declare Sub Main
Declare Sub ShowHideInspector
Declare Sub RemoteMsgHandler
Declare Sub Exit
Declare Function GetFocus Lib "User32"() as Integer
Declare Function ShowDialog Lib "Export_TEMS_Cells_Files" () as Logical
Declare Function CreateManagerDialog Lib "Export_TEMS_Cells_Files" (ByVal Handle as Integer) as Logical
Declare Function Map2Del Lib "Export_TEMS_Cells_Files" (Str as String) as Logical
Dim nWin as integer
Sub Main
Dim Handle, Start as Integer
Dim Result1, Result2, Flag1 as Logical
Dim str as string
nWin = FrontWindow()
'建立菜单
Create Menu "DialogManager" As
"Exit" Calling exit
Alter Menu Bar Add "DialogManager"
Handle = GetFocus()'获得Mapinfo窗口的句柄
Result1 = CreateManagerDialog(Handle)'建立对话框
Result2 = ShowDialog()'显示对话框
'tell the dll where its placed on the drive
str = "#S#" + ApplicationDirectory$() '传递路径
Flag1 = Map2Del(str)'传递成功则为TRUE
End Sub
Sub RemoteMsgHandler '这个就不用解释了吧,不懂看Mapbasic帮助
Dim szDelphi as string
Dim str as string
Dim bGo as logical
Dim HeadMsg as String
szDelphi = CommandInfo(CMD_INFO_MSG)
HeadMsg=Left$(szDelphi,1)
If HeadMsg="#" then
Print Right$(szDelphi,Len(szDelphi)-1)
Else
End if
End Sub
Sub Exit
DDETerminateAll
End Program
end sub
这样解释挺累的,还是自己看原代码吧:-)