1 Attachment(s)
Small Tool - Debug Window
Hi there
This a really small tool to display debug text from client and server
Hope this could help your debuging progress
Visual 2013 Solution, just build it yourself
Attachment 157935
Just a small script that handle message sent from masang
g_dbgOutwindowClassName and g_dbgOut was defined on selection build
Re: Small Tool - Debug Window
Re: Small Tool - Debug Window
Quote:
Originally Posted by
DragonLord
Well, this would work with normal DbgOut messages, as written in the article.
But as you may know masang uses their "own" debug output method:
Code:
inline void DbgOutA (LPCSTR p){
COPYDATASTRUCT cd;
HWND hWnd = ::FindWindow (g_dbgOutwindowClassName, g_dbgOut);
if (hWnd)
{
cd.dwData = 0;
cd.cbData = (strlen(p)+1)*sizeof(char);
cd.lpData = (void *)p;
::SendMessage (hWnd, WM_COPYDATA, 0, (LPARAM)&cd);
}
}
It's sending messages to a window with the name: Client DebugOutput 20020805 and registered Windowclass: Client DebugOut Window
My problem now is: i can't download ther attachement, so i can't see if this release is useless or not :D
Re: Small Tool - Debug Window
Sorry, because I don't know how to use the program from microsoft
Just a small script that handle message send from masang
Masang send message to a window with specific Class name and Title name.
I'll learn how to config the debugview from Microsoft, but I'm not sure it has a option to change the window and title name
Re: Small Tool - Debug Window
It's funny how actually somebody still have to put some efforts for make such things working...
Re: Small Tool - Debug Window
Haha, dont rage bro.
if it's not help your case, just GTFO.
Ton of people out there even don't know how to compile the source code. It's just a little tool can help them.
I just review some of your posts and I can not find any helpful reply, just rage and scold.
Try to gentle and helpful bro.
Re: Small Tool - Debug Window
Quote:
Originally Posted by
anh7codon
Haha, dont rage bro.
Nobody is raging, i'm always chilled.
Quote:
Originally Posted by
anh7codon
Ton of people out there even don't know how to compile the source code.
This is the main reason for them to stop dealing with it.
Quote:
Originally Posted by
anh7codon
I just review some of your posts and I can not find any helpful reply, just rage and scold.
Gonna cry in a corner then (still, i'm not raging).
Quote:
Originally Posted by
anh7codon
Try to gentle and helpful bro.
I help a lot of people usually, just you don't see it because all the leechers and server bitches here aren't my help target.
Have a good day.
Re: Small Tool - Debug Window
OK, but why dafaqshould we use this simple tool instead of AllocConsole() ??!!
Anyway you did smth yourself so its ok that you're able to use your brain.
Cheers
Re: Small Tool - Debug Window
Quote:
Originally Posted by
inetpub
OK, but why dafaqshould we use this simple tool instead of AllocConsole() ??!!
That is an absolutely stupid question.
Logging purposes, to say the least, let alone timestamping and not having to deal with some cheap hack-y method.
A better idea would be to use OutputDebugString(), but that is beyond the scope of this thread.
Re: Small Tool - Debug Window
Quote:
Originally Posted by
inetpub
OK, but why dafaqshould we use this simple tool instead of AllocConsole() ??!!
Anyway you did smth yourself so its ok that you're able to use your brain.
Cheers
You can trash the console if your client crashes at boot.
Quote:
Originally Posted by
DragonLord
That is an absolutely stupid question.
Logging purposes, to say the least, let alone timestamping and not having to deal with some cheap hack-y method.
A better idea would be to use OutputDebugString(), but that is beyond the scope of this thread.
I think that are more my hand's fingers than the guys which knows what this function does.
Re: Small Tool - Debug Window
About one and a half year ago (before I kindly got the tip from Dragon to use Sysinternals) I wrote a similar tool in MFC... Sadly I can't find the full code for this right now but I found the C++ part of it that took care of handling the strings output by the DbgOut underlying function:
Code:
// Window Proc override
LRESULT CClientDebugOutDlg::WindowProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_COPYDATA:
{
// Dispatch client Message
COPYDATASTRUCT* pcds = (COPYDATASTRUCT*)lParam;
if (pcds->dwData == 0)
{
// convert 8-byte char to 16-byte wchar_t
LPCSTR msg = (LPCSTR)pcds->lpData;
LPCWSTR w_msg = CA2W(msg);
handleClientDbgMessage(w_msg);
}
else if (pcds->dwData == 0xFEFF)
{
// 16-byte char
LPCWSTR msg = (LPCWSTR)pcds->lpData;
handleClientDbgMessage(msg);
}
}
break;
}
// Default Return
return CDialogEx::WindowProc(msg, wParam, lParam);
}
void CClientDebugOutDlg::handleClientDbgMessage(std::wstring message /*alternatively: const wchar_t* message*/)
{
// Handle the message here
}
Be aware that this code was used within a Unicode MFC environment. You can copy paste this into any MFC Unicode project by overriding this WndProc handler in your Dialog class.
You can easily make a standalone version of that using MultiByteToWideChar() WINAPI function and implement the case switch into your custom WndProc. If you're using MBSC instead of Unicode you'd need WideCharToMultiByte() for the other case.
If you prefer C# you could also do this via unmanged code.
Might help someone to make tools...
Edit:
And ofc the window handle must be created with the wnd class "Client DebugOut Window" and the wnd caption "Client DebugOutput 20020805"
Re: Small Tool - Debug Window
Or i can release official masang ones, but all the leechers here are too far away from deserve that.
Re: Small Tool - Debug Window
Quote:
Originally Posted by
Aesir
Or i can release official masang ones, but all the leechers here are too far away from deserve that.
By the level of "tools" released by masang I am kinda confident that everyone here would deserve them... You can't get much lower than masang level.
Re: Small Tool - Debug Window
Quote:
Originally Posted by
Future
By the level of "tools" released by masang I am kinda confident that everyone here would deserve them... You can't get much lower than masang level.
Then i guess this week i will release them ;)