Win32’s Road

virtual box network how to

Posted on Updated on

  1. 靜態配置 Host 機器上的 Virtual Box Host only 的網路介面ip : ex:
  2. 配置 Client (VM) 裏頭的兩張介面卡 IP
    1. NAT: (第一個介面, eth0)
    2. Virtual Host Only: (第二個介面, eth3)
  3. 將 Windows 上 的 LAN/Wifi 網路卡開放分享給 Virtual Box Host Only。
  4. Client 裏頭的 routing table

$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default UG 0 0 0 eth0 * U 1 0 0 eth3 * U 1 0 0 eth0

$ ping
PING ( 56(84) bytes of data.
64 bytes from icmp_req=1 ttl=58 time=7.33 ms
64 bytes from icmp_req=2 ttl=58 time=7.48 ms
64 bytes from icmp_req=3 ttl=58 time=10.7 ms
— ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 7.336/8.534/10.779/1.591 ms


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

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.