new version is out : V1.3 PR 1.859
see first post for more details.[21] OKT 17th 2007 TailBite v1.3 PR 1.859
- fixed problem with :Import section (found by srod)
Regards Klaus
Moderators: gnozal, ABBKlaus, lexvictory
Code: Select all
ProcedureDLL MyProc()
Code: Select all
Proc MyProc()
I had a quick look at the sources :srod wrote:Thinking about it Gnozal, Tailbite must parse the source and I recall El-Choni saying something to the effect that it does indeed run through and lists the procedures to be exported.
I don't think there's anything in the commented asm which labels the procedure as exported, but I'll have a look to be sure.
Code: Select all
...
PBSourceFileSize = FileSize(TBTempPath$+"PureBasic.asm")
*PBSourceFile = AllocateMemory(PBSourceFileSize)
ReadData(0, *PBSourceFile, PBSourceFileSize)
CloseFile(0)
If QuietMode=0
SetGadgetText(0,Language("TailBite","CreateFuncList"))
EndIf
ResidentFile = 0
CheckPrevious:
If CreateFunctionList(*PBSourceFile, *PBSourceFile+PBSourceFileSize)
...
Code: Select all
Procedure CreateFunctionList(FileStart, FileEnd)
Debug "CreateFunctionList()"
WriteLog("CreateFunctionList()")
...
If UCase(PeekS(*FileSeeker, 11))="; PROCEDURE" And PeekS(*FileSeeker-Len(WNL$), 2)=WNL$ And PeekB(NextSeeker+Len(WNL$))<>';' And *FileSeeker<FileEnd
IndexSeeker = FindNextString("macro MP", *FileSeeker, FileEnd)+Len("macro MP")
FIndex = Val(GetNextString(IndexSeeker, "{"))
*FileSeeker = FindNextString("; Procedure", IndexSeeker, FileStart)
*FileSeeker+11
DLLFunction = 0
If UCase(PeekS(*FileSeeker, 3))="DLL"
*FileSeeker+3
DLLFunction = 1
ElseIf UCase(PeekS(*FileSeeker, 4))="CDLL"
*FileSeeker+4
DLLFunction = 1
EndIf
...
Aye, though I reckon Fred is perhaps a little busy at the moment! The thing is that there are good arguments for placing the original PB source code (without macros being substituted for their textual content) into the generated asm. Oh well.ABBKlaus wrote:@srod,
i think you have to ask Fred to change that behaviour of a macro, since TailBite relies only on the commented ASM output that PB supplies
Regards Klaus
Code: Select all
Procedure.s GetPBFolder()
Protected hKey1.l, Type.l, Res.l, Folder$, lpbData.l, cbData.l
cbData = (#MAX_PATH*2)+2
lpbData = AllocateMemory(cbData)
Folder$=""
hKey1=0
Type=0
Res=-1
Select OSVersion()
Case #PB_OS_Windows_95,#PB_OS_Windows_98,#PB_OS_Windows_ME
Debug "Detected OS : Windows 95/98/ME"
Res=RegOpenKeyEx_(#HKEY_LOCAL_MACHINE, "Software\Classes\PureBasic.exe\shell\open\command", 0, #KEY_ALL_ACCESS, @hKey1)
Case #PB_OS_Windows_NT3_51,#PB_OS_Windows_NT_4,#PB_OS_Windows_2000,#PB_OS_Windows_XP,#PB_OS_Windows_Server_2003
Debug "Detected OS : Windows NT/2000/XP"
Res=RegOpenKeyEx_(#HKEY_CLASSES_ROOT, "Applications\PureBasic.exe\shell\open\command", 0, #KEY_ALL_ACCESS, @hKey1)
Case #PB_OS_Windows_Vista,#PB_OS_Windows_Server_2008,#PB_OS_Windows_Future
Debug "Detected OS : Windows Vista/Server 2008"
Res=RegOpenKeyEx_(#HKEY_CURRENT_USER, "Software\Classes\PureBasic.exe\shell\open\command", 0, #KEY_ALL_ACCESS , @hKey1)
EndSelect
If Res = #ERROR_SUCCESS
If RegQueryValueEx_(hKey1, "", 0, @Type, lpbData, @cbData)=#ERROR_SUCCESS
Folder$ = PeekS(lpbData)
Folder$ = GetPathPart(Mid(Folder$, 2, Len(Folder$)-7))
EndIf
RegCloseKey_(hKey1)
EndIf
If lpbData
FreeMemory(lpbData)
lpbData=0
EndIf
; ---------------------------------------------------------------
; la chaine depuis la beta4 se présente comme ceci sous Vista (sur ma machine)
; C:\Program Files\PureBasic 4.00\PureBasic.exe" "%1" /P "C:\Documents And Settings\ww\Application Data\PureBasic\PureBasic.prefs"
; je teste sur le % en ne gardant que la partie précédante
; since Beta 4, the string is somethink like that under Vista (on my computer)
; C:\Program Files\PureBasic 4.00\PureBasic.exe" "%1" /P "C:\Documents And Settings\ww\Application Data\PureBasic\PureBasic.prefs"
; I check if % is in the string and if so i keep only previous part of string.
If FindString(Folder$, "%", 1)
Folder$ = StringField(Folder$, 1, "%")
Folder$ = GetPathPart(Folder$)
EndIf
; ---------------------------------------------------------------
ProcedureReturn Folder$
EndProcedure
Did you try the latest download ?Denis wrote:@Gnozal, this is the same for your libs (almost PureColor)