星期一, 十月 24, 2005

The second day

Today I finished _beginthreadex and my cryptoCS. Quite nice~~~

_beginthreadex is changed from CreateThread. But CreateThread has to be specified the pointer to thread ID when in Windows98. It is better to use _beginthreadex or _beginthread. The former is more similar to CreateThread in parameters, in which I only change the type HANDLE into unsigned and change the returned value's type.

cryptoCS actually includes 3 functions. cryptoCS(CString a, CString b) cryptolize a into b, in which the char that larger than 'F' will be translated into hexademics.

In cryptoCS, it only transfer a into char* type, and call cryptoStr(const char* as, char* bs) to cryptolize the strings and then transfer bs into CString type to b.

In cryptoStr, it read the char one by one, judge whether it is larger than 'F' and call int2Hex(int, char*) to transfer the char. In addition, if the char is '-', just skip it.

P.S. I like to pack code in functions, however, the leading Doctor said calling function will consume the system source so that we should reduce functions. Different from Software Engineering, kernal code programming seems effection-oriented instead of object-oriented.

没有评论: