Win32’s Road

windows mysql reset root

Posted on Updated on

1. stop mysql service.
2. edit a file abcd.sql
UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass’) WHERE User=’root’;
3. mysqld.exe –console –init-file=abcd.sql
4. new root password = MyNewPass


VC++ MFC using STL, operator new: ono of the 5 overloads

Posted on Updated on

relationship between CWnd and CWinApp

Posted on Updated on

In general there are [[at least]] the following places where you can put
data and code:

the app (CWinAPP derived class)
the main frame window class
the document window class
the document class.

side-by-side error

Posted on

Download and install this to the running computer
build your application by /MTD or /MT ( Project Properties \ C++ \code generate )

timeGetTime v.s. GetTickCount()

Posted on

referenced from
first, timeGetTime is a win32 function, not a c one.

second, timeGetTime is much more accurate than GetTickCount (1 ms vs 50 ms resolution).

third, GetTickCount takes less time to execute.

fourth, nice use of the $. (stolen from Stoffel)

use GetTickCount if 50 ms resolution is acceptable because it has less overhead, and timeGetTime if you need more precise timing. remember to call timeBeginPeriod and timeEndPeriod to obtain 1 ms resolution on nt.