2008 October 8th Wednesday (十月 八日 水曜日)

来源:互联网 发布:备用信用证知乎 编辑:程序博客网 时间:2024/05/29 03:23
   I can get a cold again.  Last night I can not get a good sleep.

  These days I always think what is the happiness?  There are not a certain answer.  Every one has his or her own standard.  Thare
is not a common criterion for that.  As a matter of a fact, the happiness is just a noun.  Everyone can has different definition on
occasions.  Maybe, it is just represented as an interest relation amid people.

  Yes.  I think that the root of the relation among people is interest relation.  That is a macro-interest relation, not narrow at
the relations based on money.  That is derived from our various desires.  What it is desire?

  However, I have not found out the final answer.

  I got a utility function.  It can be used to get an absolute path of the current process.  I changed it as follow.

#include  <io.h>
#include  <stdio.h>
#include  <stdlib.h>

// get an absolute path of the current process
BOOL GetCurrentProcessDirectory(char* path)
{
    char lpszFilePath[_MAX_PATH];
    if(::GetModuleFileName(NULL, lpszFilePath, _MAX_PATH) > 0){
        char szDrive[_MAX_DRIVE];
        char szFolder[_MAX_DIR];
        char szFileName[_MAX_FNAME];
        char szExt[_MAX_EXT];

        _splitpath(lpszFilePath, szDrive, szFolder, szFileName, szExt);
        sprintf(path, "%s%s", szDrive, szFolder);

        return true;
    }

    return false;
}