• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

zTrace 2.02 (C/C++ version 32/64-bit)

Started by Patrice Terrier, May 06, 2013, 05:50:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrey Unis

Quote from: Patrice Terrier on April 21, 2017, 12:07:11 PM
By the way with only 14Kb, it could be used to debug any unicode 64-bit application...
Can make 11kb...
By the way, there are few mistakes...
function zDebug() includes NUL characters to log file
WideCharToMultiByte(CP_ACP, 0, sMessage, -1, buffer, BufferSize - 1, 0, 0);
(but better remake this function to support unicode chars (for example chinese language))

function ToolProc()
    case WM_GETMINMAXINFO:
         MoveMemory(&pMM, (MINMAXINFO*) lParam, sizeof(pMM));
         SetRect(&rc, 0, 0, MIN_WIDTH, MIN_HEIGHT);
         AdjustWindowRectEx(&rc, dwStyle, FALSE, dwExStyle);  // Adjust Window To True Requested Size
         pMM.ptMinTrackSize.x = rc.right;
         pMM.ptMinTrackSize.y = rc.bottom;
         break;

fix
case WM_GETMINMAXINFO:
SetRect(&rc, 0, 0, MIN_WIDTH, MIN_HEIGHT);
AdjustWindowRectEx(&rc, WND_Style, FALSE, WND_ExStyle);  // Adjust Window To True Requested Size
((LPMINMAXINFO)lParam)->ptMinTrackSize.x = rc.right;
((LPMINMAXINFO)lParam)->ptMinTrackSize.y = rc.bottom;
break;


case IDM_Print:
  ...
  long* SelItem = new long[nSelItems];
memory leak, missed: delete [] SelItem ;

my variant (11kb) attached

Patrice Terrier

#16
Andrey

Thank you very much for the fix.

Most are residuals of my first PowerBASIC translation at the time i was Learning C++,
zTrace was the first on my list to help me to debug my other tools.

I should have loocked more closely at my first translation.
Quote
WideCharToMultiByte(CP_ACP, 0, sMessage, -1, buffer, BufferSize - 1, 0, 0);
(but better remake this function to support unicode chars (for example chinese language))
For the debug text file, i prefer to keep using ANSI to be compatible with my old text editor,
however i shall put a new option to select between ansi or unicode.

I shall update the code with your zip file, thank you again!  8)
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

#17
Ok, the fixes have been done
http://www.objreader.com/index.php?topic=91.msg623#new

I have also updated the codeproject submission.


Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

#18
I have merged Andrei changes into a new version, with:
further code clean up,
new font set for both the listbox window and the printer,
switched back to XP compatibility,
no more TCLib linking that has been removed.

With more features, and further code optimization, we have been able to keep the size of the 64-bit Unicode DLL at only 11 Kb.

The latest zip file is available here
http://www.objreader.com/index.php?topic=91.msg618#msg618
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com