please post discussions here: http://www.powerbasic.com/support/pb...ead.php?t=4054
a total of 5 posts:
**** new **** 
------------------
-greg
[this message has been edited by gregery d engle (edited july 15, 2001).]
a total of 5 posts:
Code:
post 1 - debug.inc include file to enable debug_print post 2 - ddt example using debug.inc


Code:
posts 3, 4, and 5 don't require debug.inc and are easier to impliment post 3 - dll version of debug.inc (you don't have to call debug_initialize or debug_terminate) post 4 - debugdll.inc include file for debugdll.dll post 5 - debugdll example debug.inc
Code:
'==============================================================================' ' powerbasic debugger. ' prints text to a console window, making debugging pb/dll easier ' please contact me at [email protected] if you have any questions ' ' this is entered into public domain by greg engle 7-14-01 ' debug_initialize - to start debug engine ' debug_terminate - when you exit your program ' debug_print - prints a string to the console ' debug_print_lng - prints a long to the console ' '============================================================================== 'add these lines to your exe after "win32api.inc": ' '%debugmode = %true '#include "debug.inc" declare sub debug_print(soutput$) declare sub debug_initialize_print(soutput$, conhwnd&) declare sub debug_terminate() declare sub debug_initialize() declare sub debug_print_lng(soutput as long) sub debug_print_lng(soutput as long) #if %debugmode 'you forgot to add %debugmode = %true before #include "debug.inc" debug_initialize_print format$(soutput), 0 #endif end sub sub debug_print(soutput$) #if %debugmode debug_initialize_print soutput$, 0 #endif end sub sub debug_initialize_print(soutput$, conhwnd&) #if %debugmode static hwnd& if conhwnd& > 0 then hwnd& = conhwnd& end if local szoutput as asciiz * 255 szoutput = soutput$ & $crlf writeconsole hwnd&, szoutput, len(szoutput), %null, %null #endif end sub sub debug_terminate() #if %debugmode freeconsole #endif end sub sub debug_initialize() local conhwnd& #if %debugmode local szoutputt as asciiz * 255 allocconsole 'create the console setconsoletitle "greg's powerbasic debugger" conhwnd& = getstdhandle(%std_output_handle) setconsoletextattribute conhwnd&, %foreground_red or _ %foreground_green or %foreground_blue debug_initialize_print "greg's powerbasic debugger", conhwnd& debug_print "----------------" debug_print " #endif end sub
-greg
[this message has been edited by gregery d engle (edited july 15, 2001).]
Comment