Seems to me that because the code is pre-compiled as a lib, the debugger constants are ignored ?
All help appreciated.
Zebuddi.
Code:
Code: Select all
;#IDEWindowID = 4654100
ProcedureDLL _WriteIDELog(sMessage.s); Write a message to IDE Log
Protected CopyData.COPYDATASTRUCT
Protected IDEWindow = Val(GetEnvironmentVariable("PB_Tool_MainWindow"))
CompilerIf #PB_Compiler_Debugger
CompilerIf #PB_Compiler_IsMainFile
MessageRequester("in debugger mode", "grrrr..") ; for debugging cause wont work
CompilerEndIf
; when compiled a pb user lib
CompilerIf Not Defined(IDEWindowID, #PB_Constant)
MessageRequester(#PB_Compiler_Procedure +
"() ... IDEWindow ID not Defined",
"Add The Constant " +
"'#IDEWindowID = '" +
" With the 'IDEWindow Value' to Your Source Code - Dohhhh..",
#PB_MessageRequester_Error)
End
CompilerElse
IDEWindow = #IDEWindowID
CompilerEndIf
CompilerEndIf
If (IDEWindow And sMessage)
CopyData\dwData = ('L' << 16) | ('O' << 8) | 'G'
CopyData\cbData = StringByteLength(sMessage, #PB_Ascii)
CopyData\lpData = AllocateMemory(CopyData\cbData + 1)
If CopyData\lpData
PokeS(CopyData\lpData, sMessage, -1, #PB_Ascii)
SendMessage_(IDEWindow, #WM_COPYDATA, #Null, @CopyData)
FreeMemory(CopyData\lpData)
EndIf
EndIf
EndProcedure
_WriteIDELog("Holy molly ... grrr")