Author Topic: zTrace 2.02 (C/C++ version 32/64-bit)  (Read 9522 times)

0 Members and 1 Guest are viewing this topic.

Offline Andrey Unis

  • Newbie
  • *
  • Posts: 2
Re: zTrace 3.00 64-bit is also on codeproject
« Reply #15 on: April 26, 2017, 01:40:46 AM »
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()
Code: [Select]
    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
Code: [Select]
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

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2401
  • Gender: Male
    • www.zapsolution.com
Re: zTrace 2.02 (C/C++ version 32/64-bit)
« Reply #16 on: April 26, 2017, 09:47:39 AM »
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)
« Last Edit: April 26, 2017, 10:11:58 AM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2401
  • Gender: Male
    • www.zapsolution.com
Re: zTrace 2.02 (C/C++ version 32/64-bit)
« Reply #17 on: April 26, 2017, 04:49:18 PM »
Ok, the fixes have been done
http://www.objreader.com/index.php?topic=91.msg623#new

I have also updated the codeproject submission.


« Last Edit: April 26, 2017, 05:10:09 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Patrice Terrier

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2401
  • Gender: Male
    • www.zapsolution.com
Re: zTrace 2.02 (C/C++ version 32/64-bit)
« Reply #18 on: April 27, 2017, 07:23:21 PM »
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
« Last Edit: April 27, 2017, 07:27:42 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com